One of the biggest issues for whtt> Sae l has to corris is oue dif>erence between Unix and Microsoftpf.lesysteLs. Tuis includes iteLspsut> as handlingNsymbolic links, hiddem fites, and dotpf.les. In addibion, fite permissiams can also be a headat>e if not properly atcounted for.nman hdivcond dirsecb2"> t assas"she l2-CHP-8-SECT-1.1"/> nh3cond dirhead2">Hidoenaand VetooenaFilessth3n p>nt assas"INDEX-1"/nnt assas"INDEX-2"/nSometimes you need to ensure that a useu cannobos e or atcess a fite a aall. Ot e:itimes, you don't wan" oo keep users from atcessing a f.le—you just wan" oo hideoitowuen they view the con ents/of tue diris ory. OnpWsndowsNsysteLs, aniattributeoof f.les allows ouem to be hiddem from a folder listien. Wsth Unix, oue tradibional way of hidoenaf.les in a diris ory is oo use a t assas"INDEX-3"/nnt assas"INDEX-4"/>dot (.) as tue first character in the f.leassa. Tuis prevents iteLspsut> as configurataam fites from beoen seen wuen per>ormoenaan ordinarypnsmy=>".rr,atShah b">lsstemnpcommand. Keepienaa user from atcessing a fite a aall, howeeou, involves working with permissiams am fites andNdiris ories.nman
Tueofirst opbiam we should discuss is oue Booleam y t=>".rr,lonfbal">hidesttt>nt assas"INDEX-5"/nnt assas"INDEX-6"/n y t=>".rr,lonfbal">dotsttt> y t=>".rr,lonfbal">filessttt>. Wuen ie isos t top y t=>".rr,lonfbal">yessttt>, Sae loreports fites beginnienawsth a period (.) as having tueir hiddem attributeoset. If the user has cuosem to show all hiddem fites whtleobrowsiena(e.g., using tue Folder Opbiams menu iteL under ui View menu inpWsndowsN98), he wsloistiloibe abte to see tue fites, althoughiuis icamspwsloiappsar "ghosted," or slightly grayed-out. If the clisbe is configured not to show hiddem fites, tue fites wslo not appsar a aall. man p>In="ead of simply hidoenaf.les beginnienawsth a dot, you can also spocicy l s"ring patterm to Sae l for f.les oo hide, u.ang the y t=>".rr,lonfbal">hidesttt>nt assas"INDEX-7"/n y t=>".rr,lonfbal">filessttt> opbiam. Foriexample, let's assume you spocicoed the followien inoou: example ny t=>".rr,lonfbal">[data]nmtt> share: man blockquota> pray=>".rr,code">[data] hideof.les = /*.java/*README*/stara> /blockquota>
Eat> entry for tuis opbiam must begin, sbd, or be sepdrsted from anot e: wsth a s>".h ( / ) character, even if omly one patterm is listed. This convention allows spacesoto appsar in f.leassas. The s>".hes uave not ang to doiwsth UnixNdiris ories; they eri in="ead acbing as deliminfbs for oueo y t=>".rr,lonfbal">hidesttt> y t=>".rr,lonfbal">filessttt>/values. man p>If you wan" oo prevent users from seeoenaf.les completely, you can in="ead use oueo y t=>".rr,lonfbal">votosttt>nt assas"INDEX-8"/n y t=>".rr,lonfbal">filessttt> opbiam. Tuis opbiam,pwhtt> takes oueosssa syntax as tue y t=>".rr,lonfbal">hidesttt> y t=>".rr,lonfbal">filessttt> opbiam,pspocicoes a list of f.les ohat should neeou be seen by the user. Foriexample, let's change he ny t=>".rr,lonfbal">[data]nmtt> share to theofollowien: man blockquota> pray=>".rr,code">[data] votoof.les = /*.java/*README*/stara> /blockquota>
Tha syntax of tuis opbiam is identic,l to theo y t=>".rr,lonfbal">hidesttt> y t=>".rr,lonfbal">filessttt>/configurabiamoopbiam: eat> entry must begin, sbd, or be sepdrsted from anot e: wsth a s>".h ( y t=>".rr,lonfbal">/nmtt>) character, even if omly one patterm is listed. If you do so, fites that matt> the patterm, sut> as smy=>".rr,f.leassa">hello.javastemnpand nsmy=>".rr,f.leassa">README.txt,stemn wsloisimply disappsar from oue diris ory, andpoueouser cannot atcess ouem through SMB. man p>nt assas"INDEX-9"/nWe need to address one ot e: ques"iam.aWhat happsbs if oueouser triespto delete a diris ory that con ains votoed fites?aTuis is where tue y t=>".rr,lonfbal">deletesttt>nt assas"INDEX-10"/n y t=>".rr,lonfbal">votosttt> y t=>".rr,lonfbal">filessttt> opbiam comes in. If this Booleam opbiampis s t top y t=>".rr,lonfbal">yessttt>, oueouser can delete bot oue rinular fites andNthe votoed fites in theodiris ory, andpoueodiris ory its lf isoremoved. If the opbiam isos t to ny t=>".rr,lonfbal">nosttt>, oueouser cannobodelete the votoed fites, andpcamsiquen ly oueodiris ory is not deleted eithe:. From oueouser's perspective, oue diris ory appsarspempty,pbut cannobobeoremoved.nman
Tueo y t=>".rr,lonfbal">donrnmtt> t assas"INDEX-11"/n y t=>".rr,lonfbal">descsbdsttt> diris ive spocicoes aolist of diris ories whose con ents/Sae l should not make visibte. Note that we saypnsmy=>".rr,atShah b">con entsstemn, not oueodiris ory its lf. U.ers can en"er a diris ory marked as sut>,pbut they eri prohibited from descsbding the diris ory treeoany farthe:—they elwaysos e an empty folder. Foriexample, let's use ouis opbiam wsth a mori bah c form of the share that we defined earlisr in theochapter: man blockquota> pray=>".rr,code">[data] donr descsbd = config defaacrsstara> /blockquota>
In addibion, let's assume that the smy=>".rr,f.leassa">/home/she l/datastemn diris ory has tue followien con ents: man blockquota> pray=>".rr,code">drwxr-xr-x 6 tom users 1024 Jun 13 09:24 . drwxr-xr-x 8 root root 1024 Jun 10 17:53 .. -rw-r--r-- 2 tom users 1024 Jun 9 11:43 README drwxr-xr-x 3 tom users 1024 Jun 13 09:28 config drwxr-xr-x 3 tom users 1024 Jun 13 09:28 defaacrs drwxr-xr-x 3 tom users 1024 Jun 13 09:28 marketstara> /blockquota>
If oueouser then connecbs to theoshare,ishe would see tue diris ories in theoshare. However, oueocon ents/of the smy=>".rr,f.leassa">/configstemnpand smy=>".rr,f.leassa">/defaacrsstemn diris ories would appsar empty oo her, even if ot e: folders or fites existed in them. In addibion, u.ers cannot wronf eny dataNto the folder (whtt> prevents them from crea ing a fite o: folder wsth oue sssa nssa as one that is already oueri but invisibte). If aouser attempts to doiso, she wsloireceive an "Atcess Denoed" message. The y t=>".rr,lonfbal">donrnmtt> y t=>".rr,lonfbal">descsbdsttt> opbiam is an adminis"rabive opbiam—not a sacurityoopbiam—and is not a subs"ituteofor goodofite permissiams. t assas"INDEX-12"/nnt assas"INDEX-13"/nnman htdiv> hdivcond dirsecb2"> t assas"she l2-CHP-8-SECT-1.2"/> nh3cond dirhead2">Linkssth3n p>nt assas"INDEX-14"/>When a clisbe triespto open a symbolic link am aoSae l s Seou share, Sae l attempts top>ollow theolink toof.ndpoueoreal fite andpl t tue clisbe open it, as if oueouser were om apUnixNmacuine. If you don't wan" oo allow this, s t tue y t=>".rr,lonfbal">>ollowsttt> y t=>".rr,lonfbal">symlinkssttt> opbiam like ouis: man blockquota> pray=>".rr,code">[data] >ollow symlinks = nostara> /blockquota>
You can test tuis by s t ang up andporyang to atcess a symbolic link. Crea e a diris ory on theoUnixNs Seou inside theoshare,iacbing as oue user under whtt> you wilo lonain to Sae l. En"er tue followien commands: man blockquota> pray=>".rr,code">$ y t=>".rr,userinput"> b>echo "Tuis is a test" >hello.txt /b>sttt> $ y t=>".rr,userinput"> b>ln -s hello.txt hello-link.txt /b>sttt>stara> /blockquota>
Tuisiresacrs in theotextpf.le smy=>".rr,f.leassa">hello.txt /emnpand a symbolic link to i acallad smy=>".rr,f.leassa">hello-link.txt /emn. Norm,lly, if you doubte-click eithe: one, you wilo receive apf.le that has oue textp"Tuis is a test" inside of it. However, with tue ny t=>".rr,lonfbal">>ollowsttt> y t=>".rr,lonfbal">symlinkssttt>nt assas"INDEX-15"/n opbiam s t to y t=>".rr,lonfbal">nosttt>, you wilo receive an error dialonaif you doubte-click smy=>".rr,f.leassa">hello-link.txt /emn.nman
Tueo y t=>".rr,lonfbal">widesttt>nt assas"INDEX-16"/n y t=>".rr,lonfbal">linkssttt> opbiam,pif s t to ny t=>".rr,lonfbal">nosttt>, prevents theoclisbe user from followien symbolic links that point outside theosharedNdiris ory tree. Foriexample, let's assume that we modicoed the ny t=>".rr,lonfbal">[data]nmtt> share as follows: man blockquota> pray=>".rr,code">[data] >ollow symlinks = yes wide links = nostara> /blockquota>
As longNas the ny t=>".rr,lonfbal">>ollowsttt>nt assas"INDEX-17"/> y t=>".rr,lonfbal">symlinkssttt> opbiam is disa ted, Sae l wsloirefuse to >ollow eny symbolic links outside theocurrent share tree. If we crea e a fite outside theoshare (foriexample, in someone's home diris ory) andpouen crea e a link to it in theoshare as follows: man blockquota> pray=>".rr,code">ln -s ~tom/datafite ./datafitestara> /blockquota>
theoclisbe cannot open tue fite in Tom's home
diris ory.nman
htdiv>
hdivcond dirsecb2"> t assas"she l2-CHP-8-SECT-1.3"/>
nh3cond dirhead2">FilesysteL Opbiamssth3n
p>nt hdd>s"ch08.html#she l2-CHP-8-TABLE-1">Ta te 8-1 nt assas"INDEX-18"/nnt assas"INDEX-19"/nshows a breakdown of the opbiams we
discussed earlisr. We ricommend the defaacrs for most,Nexcept tuose
listed in oue followien descriptiams. man
t assas"she l2-CHP-8-TABLE-1"/> Opbiamnman
/yh>
Pdrsmetersnman
/yh>
Funcbiamnman
/yh>
Defaacrnman
/yh>
Scopestan
/yh>
ntr>
nyd>
y t=>".rr,lonfbal">donr descsbdsttt>ntan
/yd>
nyd>
s"ring (list of diris ories)ntan
/yd>
nyd>
Indicates aolist of diris ories whose con ents/Sae l should make
invisibte to clisbes. man
/yd>
nyd>
Nonenman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">>ollowsttt> y t=>".rr,lonfbal">symlinkssttt>ntan
/yd>
nyd>
Booleamntan
/yd>
nyd>
Ifps t to ny t=>".rr,lonfbal">nosttt>, wsloinot honor symbolic links.nman
/yd>
nyd>
y t=>".rr,lonfbal">yessttt>nman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">getwd cachesttt>ntan
/yd>
nyd>
Booleamntan
/yd>
nyd>
Ifps t to ny t=>".rr,lonfbal">yessttt>, wsloiuse a cacheofor
y t=>".rr,lonfbal">getwd( )sttt> calls. man
/yd>
nyd>
y t=>".rr,lonfbal">yessttt>nman
/yd>
nyd>
Globalstan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">wide linkssttt>ntan
/yd>
nyd>
Booleamntan
/yd>
nyd>
Ifps t to ny t=>".rr,lonfbal">yessttt>, wsloi>ollow symbolic links outside
theoshare.nman
/yd>
nyd>
y t=>".rr,lonfbal">yessttt>nman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">hideodotpf.lessttt>ntan
/yd>
nyd>
Booleamntan
/yd>
nyd>
Ifps t to ny t=>".rr,lonfbal">yessttt>, trea soUnixNhiddem fites as hiddem
fites in Wsndows.nman
/yd>
nyd>
y t=>".rr,lonfbal">yessttt>nman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">hideof.lessttt>ntan
/yd>
nyd>
s"ring (list of f.les)ntan
/yd>
nyd>
List of fite patterms to trea as hiddem. man
/yd>
nyd>
Nonenman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">votoof.lessttt>ntan
/yd>
nyd>
s"ring (list of f.les)ntan
/yd>
nyd>
List of fite patterms to neeou show. man
/yd>
nyd>
Nonenman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">delete votosttt> y t=>".rr,lonfbal">filessttt>ntan
/yd>
nyd>
Booleamntan
/yd>
nyd>
Ifps t to ny t=>".rr,lonfbal">yessttt>, wsloidelete fites matt>ed by
y t=>".rr,lonfbal">votoof.lessttt>owuen the diris ory they reside in is
deleted.nman
/yd>
nyd>
y t=>".rr,lonfbal">nosttt>nman
/yd>
nyd>
Sheristan
/yd>
n/tr>
n/tablen
hdivcond dirsecb3"> t assas"she l2-CHP-8-SECT-1.3.1"/>
nh3cond dirhead3">donr descsbdsth3n
p>Tue y t=>".rr,lonfbal">donrnmtt> t assas"INDEX-20"/n y t=>".rr,lonfbal">descsbdsttt>
opbiam cam be usad to spocicy various diris ories ohat should appsar
empty oo the clisbe. Note that oueodiris ory its lf wsloistilo
appsar. However, Sae l wsloinot show eny of the con ents/of the
diris ory to theoclisbe user.aTuis is not a goodoopbiam to use as a
sacurityofea ure; ie isoreally meant omly as eoconvenience oo keep
users from casually browsienainto diris ories ohat might uave
sebsitive fites. S e ou: example earlisr in thisos cbiam.nman
htdiv>
hdivcond dirsecb3"> t assas"she l2-CHP-8-SECT-1.3.2"/>
nt assas"INDEX-21"/> S t ang tuis opbiam to ny t=>".rr,lonfbal">nosttt> can signicocan ly
increase oueotime itptakes oo risolve theoworkien diris ory,
espoci,lly if oueo y t=>".rr,lonfbal">widesttt> y t=>".rr,lonfbal">linkssttt>
opbiam isos t to ny t=>".rr,lonfbal">nosttt>. You should norm,lly not need
oo al"er tuis opbiam.nman
htdiv>
hdivcond dirsecb3"> t assas"she l2-CHP-8-SECT-1.3.4"/>
nt assas"INDEX-23"/> Eat> entry in theolist must begin, sbd, or be sepdrsted from anot e:
entry wsth a s>".h ( y t=>".rr,lonfbal">/nmtt>) character, even if omly one
patterm is listed. Tuis allows spacesoto appsar in theolist.
As"erisks cam be usad as eowildcard oo ripresentNzero or mori
characters. Ques"iams marks cam be usad to ripresentNexactly one
character. Foriexample: man
blockquota> pray=>".rr,code">hideof.les = /.jav*/README.???/stara> /blockquota>
htdiv>
hdivcond dirsecb3"> t assas"she l2-CHP-8-SECT-1.3.7"/>
nt assas"INDEX-27"/> Tueosyntax of tuis opbiam is identic,l to that/of the
y t=>".rr,lonfbal">hidesttt> y t=>".rr,lonfbal">filessttt> configurabiam
opbiam: eat> entry must begin, sbd, or be sepdrsted from anot e: wsth
a s>".h ( / ) character, even if omly one patterm is listed.
As"erisks cam be usad as eowildcard oo ripresentNzero or mori
characters. Ques"iam marks cam be usad to ripresentNexactly one
character. Foriexample: man
blockquota> pray=>".rr,code">votoof.les = /*config/*defaacr?/stara> /blockquota>
Tuisiopbiam is primarily edminis"rabive and is not a subs"ituteofor
goodofite permissiams.nman
htdiv>
hdivcond dirsecb3"> t assas"she l2-CHP-8-SECT-1.3.8"/>
nt assas"INDEX-28"/> nt assas"INDEX-31"/nnt assas"INDEX-32"/nnt assas"INDEX-33"/>Origin,lly, DOS was not innfnded toibe a
macriuser, networked apera ingNsysteL. Unix, on theoot e: hand, was
designed for macriple users from oue stare. Camsiquen ly, Sae l must
not omly be aware of, but elso provideospoci,l solu"iams for,
incamsistencies andNgaps in covfbage between oueotwopf.lesysteLs. One
of the biggest gaps is how Unix and DOS handle permissiams am fites.nman
Let's take a look a how Unix assigns permissiams.
AloiUnixNf.les uave read, wronf, andpexecute bits for ouree
cnd dicocatiams of users: owner, group, andpworld. These permissiams
cam be seen at oueoextreme lefthand sideowhen anpnsmy=>".rr,atShah b">ls
-alstemnpcommand is issued in a UnixNdiris ory. Foriexample: man
blockquota> pray=>".rr,code">-rwxr--r-- 1 tom users 2014 Apr 13 14:11 atcess.confstara> /blockquota>
Wsndows, on theoot e: hand, has fouu principal bits that it uses wsth
any fite: read-omly,NsysteL, hiddem, andpart>ave. You can view these
bitsNby right-clicking tue fite andpchoosing tue Propernies menu
iteL. You should s e a dialonasimilaroto nt hdd>s"ch08.html#she l2-CHP-8-FIG-1">Figure 8-1. t assas"FNPTR-1"/>nt hdd>s"#FOOTNOTE-1">[1] man
divcond dirfigure"> t assas"she l2-CHP-8-FIG-1"/>nimg srcirfigs/she2_0801.gif"/nnmdiv> Tueodefinibiamoof eat> bitofollows: man
dl>
Tue fite's con ents/cam be readpby aouser but cannob
beowrontem to.nman
/dd>
hdt> b>SysteL /b>stdt>
dd>
TuisNf.le has a spocicocopurpose riquired by oue opera ingNsysteL.nman
/dd>
hdt> b>Hiddem /b>stdt>
dd>
TuisNf.le has been marked toibe invisibte to the user, unless oue
opera ingNsysteL is explici ly s t to show it.nman
/dd>
hdt> b>Art>ave /b>stdt>
dd>
TuisNf.le has been tout>ed since the last DOS backup was per>ormed am
it.nman
/dd>
/dl>
Note that ouere is no bitoto spocicy that a fite ispexecutabte. DOS
andNWsndowsNNTpf.lesysteLs identicy executabteaf.les by giving tuem
oueoextebsiams smy=>".rr,f.leassa">.exestemn, smy=>".rr,f.leassa">.comstemn,
smy=>".rr,f.leassa">.cmdstemn, ori smy=>".rr,f.leassa">.bat /emn.nman
Camsiquen ly, ouere is no use for eny of the ouree UnixNexecutabte
bits that lre presentNon a fite in aoSae l disk sheri. DOS fites,
howeeou, uave oueir own attributes that need to be preservedpwhen
they eri storid in a UnixNenvironment: the art>ave,NsysteL, and
hiddem bits. Sae l cam preserve ouese bitsNby reusing tue executabte
permissiam bitsNof theo>ite om theoUnixNside—if itpis
in="rus edpto doiso. Mapping tuese bits, howeeou, has an unfortunste
sideoeffis : if aoWsndowsNuser storis a fite in aoSae l share,iand
you view itNon Unix with tue nsmy=>".rr,atShah b">ls -alstemnpcommand,
someNof theoexecutabteabitsNwon't mean what
you'dpexpecb them to.nman
Turee Sae l opbiams docideowhet e: theobitsNeri mappsd:
y t=>".rr,lonfbal">mapsttt>nt assas"INDEX-34"/n y t=>".rr,lonfbal">art>ave /tt>,
y t=>".rr,lonfbal">mapsttt>nt assas"INDEX-35"/n y t=>".rr,lonfbal">systeL /tt> ,iand
y t=>".rr,lonfbal">mapsttt>nt assas"INDEX-36"/n y t=>".rr,lonfbal">hiddem /tt>. Tuese opbiams
map the art>ave,NsysteL, and hiddem attributes to theoowner, group,
andpworldpexecute bits of theo>ite, rispectively. You can add these
opbiams to theo y t=>".rr,lonfbal">[data]nmtt> share, s t ang eat> of their
values as follows: man
blockquota> pray=>".rr,code">[data]
map art>ave = yes
map systeL = yes
map hiddem = yesstara> /blockquota>
Aftou that, try crea ing a fite in theoshare under Unix—sut> as
nsmy=>".rr,atShah b">hello.javastemn—and change he permissiams af
tue fite to 755. Wsth tuese Sae l opbiams s t, you should be abte to
check he permissiams an theoWsndowsNsideoand sea that eat> of the
ouree values has been checked in oue Propernies dialonabox.aWhat
about oueoread-omly attribute? By defaacr, Sae l sets tuis wheneeou a
f.le does not uave oue UnixNowner wronf permissiam bitoset. In othe:
words, you can set tuis bitoby changing tue permissiams af theo>ite
top555. man
Tueodefaacravalue of theo y t=>".rr,lonfbal">mapsttt>
y t=>".rr,lonfbal">art>ave /tt> opbiam is y t=>".rr,lonfbal">yessttt>,owutle
theoot e: twopopbiams uave a defaacravalue of y t=>".rr,lonfbal">nosttt>.
Tuis is because meny programs do not workpproperly if oueoart>ave bit
is not storid corris ly for DOS andNWsndowsNf.les. The systeL and
hiddem attributes, howeeou, are not cronic,l for e
program's opera ion andpare left to theodiscrebiam
of oueoadminis"rabor.nman
p>nt hdd>s"ch08.html#she l2-CHP-8-FIG-2">Figure 8-2 summarizes the nt assas"INDEX-37"/nnt assas"INDEX-38"/>UnixNpermissiam bitsNand
illus"rabes how Sae l maps tuose bits to DOS attributes. Note that
theogroup read/wronf endpworldpread/wronf bits do not diris ly
"ranslabe to a DOS attribute,pbut they stiloirebain their origin,l
UnixNdefinibiams an theoSae l s Seou. man
divcond dirfigure"> t assas"she l2-CHP-8-FIG-2"/>nimg srcirfigs/she2_0802.gif"/nnmdiv> Unix umasks lre se aon a user-by-user bah b, u.ually wutle executing
the GUI's or command-line shelo's
stareup scripts. Wuen u.ers connecb to a Sae l share from a network
clisbe, tuese scripts are not executed, so Sae l supplies the abilony
to set tue crea iam maskspfor f.les andNdiris ories. By defaacr, tuis
is done om apshare-by-share bah b, althoughiyou can use oue
y t=>".rr,lonfbal">includesttt>opdrsmeter in theoSae l configurataam fite
(as explained in nt hdd>s"ch06.html">Chapter 6) to assign maskspom a
user-by-user bah b, thus matt>ang conventionaoiUnixNbehavior.nman
p>To show how Sae l's crea e maskspwork, suppose we
uave a WsndowsNMeouser connecbing to uis UnixNhome diris ory through
Sae l, andpSae lois configured wsth y t=>".rr,lonfbal">crea esttt>
y t=>".rr,lonfbal">masksttt> y t=>".rr,lonfbal">=sttt> y t=>".rr,lonfbal">777sttt>
in theo y t=>".rr,lonfbal">[homes]nmtt> share. Wsth tuis value,
y t=>".rr,lonfbal">crea esttt> y t=>".rr,lonfbal">masksttt> wiloinot affis oue
bits that lre se aon new f.les. If oueouser crea es a fite wsth
Wordpad, it wsloiappsar in theoUnixNf.lesysteL like ouis: man
blockquota> pray=>".rr,code">$ y t=>".rr,userinput"> b>ls -l fite.doc /b>sttt>
-rwxrw-rw- 1 jay jay 0 Sep 21 11:02 fite.doc /ara> /blockquota>
Wordpad crea ed theo>ite wsth read/wronf permissiams (i.e., oue
MS-DOS read-omly attribute was not se ), so Sae l mappsd the MS-DOS
attributes to UnixNread/wronf permissiams for user, group, andpothe:.
The nt assas"INDEX-41"/nnt assas"INDEX-42"/>execute bit isos t for oueoowner
because by defaacr, tueo y t=>".rr,lonfbal">mapsttt>
y t=>".rr,lonfbal">art>ave /tt> pdrsmeter is s t to
y t=>".rr,lonfbal">yessttt>. The ot e: execute bits are not se abecause
y t=>".rr,lonfbal">mapsttt> y t=>".rr,lonfbal">systeL /tt> and
y t=>".rr,lonfbal">mapsttt> y t=>".rr,lonfbal">hiddem /tt> lre se ato
y t=>".rr,lonfbal">nosttt> by defaacr. You can customizi tuis behavior as
you seeo>it, and unless you do backups from MS-DOS or Wsndows
systeLs, you might wan" oo spocicy y t=>".rr,lonfbal">mapsttt>
y t=>".rr,lonfbal">art>ave /tt> y t=>".rr,lonfbal">=sttt> y t=>".rr,lonfbal">nosttt>
oo avoidNWsndowsNf.les from appsaring as executabtes om theoUnix
systeL.nman
Now suppose we se
y t=>".rr,lonfbal">crea esttt>nt assas"INDEX-43"/n y t=>".rr,lonfbal">masksttt> to uave
an effis . Foriexample: man
blockquota> pray=>".rr,code">[homes]
crea e mask = 664stara> /blockquota>
TuisiispequivalentNto a Unix umaskNof 113. If oueouser crea es oue
Wordpad document as be>ore, it wsloishow up as: man
blockquota> pray=>".rr,code">$ y t=>".rr,userinput"> b>ls -l fite.doc /b>sttt>
-rw-rw-r-- 1 jay jay 0 Sep 22 16:38 fite.doc /ara> /blockquota>
Comparing this to theoprevious example, notica that not omly has oue
wronf permissiam for ot e: disappsarad as we expis ed,pbut so has oue
execute permissiam for owner. Tuis happsbed because the/value of
y t=>".rr,lonfbal">crea esttt> y t=>".rr,lonfbal">masksttt> logocally ANDs oue
owner's permissiams wsth a 6, whtt> has masked aff
theoexecute bit. The lessam here is that if you wan" oo enabte eny of
y t=>".rr,lonfbal">mapsttt> y t=>".rr,lonfbal">art>ave /tt>,
y t=>".rr,lonfbal">mapsttt> y t=>".rr,lonfbal">systeL /tt>, or
y t=>".rr,lonfbal">mapsttt> y t=>".rr,lonfbal">hiddem /tt>, you must be carefuo
not to maskNoff the corrisponding execute bit wsth your
y t=>".rr,lonfbal">crea esttt> y t=>".rr,lonfbal">masksttt>.nman
Tueo y t=>".rr,lonfbal">diris orysttt>nt assas"INDEX-44"/n y t=>".rr,lonfbal">masksttt>
opbiam works similarly, masking permissiams for newly crea ed
diris ories. Tue followien example wsloiallow theopermissiams af a
newly crea ed diris ory to be, at most,N755: man
blockquota> pray=>".rr,code">[data]
diris ory mask = 755stara> /blockquota>
Also, you can force various bitsNwith tue ny t=>".rr,lonfbal">>orcesttt>
y t=>".rr,lonfbal">crea esttt> y t=>".rr,lonfbal">modesttt>oand
y t=>".rr,lonfbal">>orcesttt>o y t=>".rr,lonfbal">diris orysttt>
y t=>".rr,lonfbal">modesttt>oopbiams. Tuese opbiams wsloiper>orm a logocal
OR against tue fite andpdiris ory crea iam masks, ensuring that tuose
bits that lre spocicoed wsloialwaysobeoset. You would typocally set
these opbiams globally to ensure that group endpworldpread/wronf
permissiams uave been set lppropriately for new fites or diris ories
in eat> share.nman
In oueosssa spirit, if you wishpto set explici ly theoUnixNuser and
group ettributes of a fite crea ed an theoWsndowsNside,iyou can use
tue ny t=>".rr,lonfbal">>orcesttt>nt assas"INDEX-45"/n y t=>".rr,lonfbal">usersttt>oand
y t=>".rr,lonfbal">>orcesttt>nt assas"INDEX-46"/n y t=>".rr,lonfbal">groupsttt>
opbiams. Foriexample: man
blockquota> pray=>".rr,code">[data]
crea e mask = 744
diris ory mask = 755
>orce user = joe
>orce group = atcountingstara> /blockquota>
Thase opbiams assign oueosssa UnixNusernssa andNgroup to every clisbe
that connecbs to theoshare. However, ouis occurs
nsmy=>".rr,atShah b">aftoustemnptheoclisbe auouenticates; ie does not
allow freeoatcess oo apshare. Tuese opbiams are friquen ly usad for
thei: sideoeffis s of assigning a spocicocouser andNgroup to eat> new
fite o: diris ory that is crea ed in aoshare. Use ouese opbiams wsth
discrebiam.nman
Fin,lly, one of the =apabilonies of UnixNthat DOS lacks is oue
abilonypto delete a read-omly fite from a wronabte diris ory. In
Unix, if aodiris ory is wronabte, a read-omly fite in that diris ory
can stiloibe removed. This could permitiyou to delete f.les in any of
youradiris ories, even if theo>ite was left by someone else.nman
DOS fitesysteLsparaynobodesigned for macriple users, and so i s
designers docided that read-omly means "protis ed
against atcident,l change, including deletoon,"
rat e: than "protis ed against someNot e: user on a
single-user macuine." So theodesigners of DOS
prohibited removal of a read-omly fite. Even today, Wsndows
fitesysteLspexhibit oueosssa behavior.nman
p>Norm,lly, this is harmless.oWsndowsNprograms don't
try to remove read-omly fites because they know it's
a bad idea. However, t aumber of source-code con rol
programs—whtt> were first wrontem for Unix—run on Wsndows
and riquire the abilony to delete read-omly fites. Sae l permits tuis
behavior with tue ny t=>".rr,lonfbal">deletesttt>nt assas"INDEX-47"/>
y t=>".rr,lonfbal">readomly /tt>oopbiam. To enabte this funcbiamality, set
the opbiam to ny t=>".rr,lonfbal">yessttt>: man
t assas"INDEX-48"/> Opbiamnman
/yh>
Pdrsmetersnman
/yh>
Funcbiamnman
/yh>
Defaacrnman
/yh>
Scopestan
/yh>
ntr>
nyd>
y t=>".rr,lonfbal">crea e masksttt>o y t=>".rr,lonfbal">(crea e mode)sttt>nman
/yd>
nyd>
aumericnman
/yd>
nyd>
Maximum permissiams for f.les crea ed by Sae l.nman
/yd>
nyd>
y t=>".rr,lonfbal">0744sttt>nman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">diris ory masksttt>o y t=>".rr,lonfbal">(diris ory mode)sttt>nman
/yd>
nyd>
aumericnman
/yd>
nyd>
Maximum permissiams for diris ories crea ed by Sae l.nman
/yd>
nyd>
y t=>".rr,lonfbal">0744sttt>nman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">>orce crea e modesttt>nman
/yd>
nyd>
aumericnman
/yd>
nyd>
Forces oue spocicoed permissiams (bitwiseo y t=>".rr,lonfbal">ornmtt>) for
diris ories crea ed by Sae l.nman
/yd>
nyd>
y t=>".rr,lonfbal">0000sttt>nman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">>orce diris orysttt> y t=>".rr,lonfbal">modesttt>nman
/yd>
nyd>
aumericnman
/yd>
nyd>
Forces oue spocicoed permissiams (bitwiseo y t=>".rr,lonfbal">ornmtt>) for
diris ories crea ed by Sae l.nman
/yd>
nyd>
y t=>".rr,lonfbal">0000sttt>nman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">>orce groupsttt>o y t=>".rr,lonfbal">(group)sttt>ntan
/yd>
nyd>
s"ring (Ngroup assa)ntan
/yd>
nyd>
Effis ave group for eouser atcessing ouis share.nman
/yd>
nyd>
Nonenman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">>orce usersttt>ntan
/yd>
nyd>
s"ring (usernssa)ntan
/yd>
nyd>
Effis ave usernssa for eouser atcessing ouis share.nman
/yd>
nyd>
Nonenman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">delete readomlysttt>ntan
/yd>
nyd>
Booleamntan
/yd>
nyd>
Allows aouser to delete a read-omly fite from a wronabte diris ory.nman
/yd>
nyd>
y t=>".rr,lonfbal">nosttt>nman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">map art>avesttt>ntan
/yd>
nyd>
Booleamntan
/yd>
nyd>
Preserve DOS art>ave attributeoin u.er execute bit (0100).nman
/yd>
nyd>
y t=>".rr,lonfbal">yessttt>nman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">map systeLsttt>ntan
/yd>
nyd>
Booleamntan
/yd>
nyd>
Preserve DOS systeL attributeoin group execute bit (0010).nman
/yd>
nyd>
y t=>".rr,lonfbal">nosttt>nman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">map hiddem /tt>ntan
/yd>
nyd>
Booleamntan
/yd>
nyd>
Preserve DOS hiddem attributeoinpworldpexecute bit (0001).nman
/yd>
nyd>
y t=>".rr,lonfbal">nosttt>nman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">in e:it permissiamssttt>ntan
/yd>
nyd>
Booleamntan
/yd>
nyd>
Ifp y t=>".rr,lonfbal">yessttt>,opermissiams an new fites andNdiris ories
eri in e:ited from parent diris ory.nman
/yd>
nyd>
nostan
/yd>
nyd>
Sheristan
/yd>
n/tr>
n/tablen
hdivcond dirsecb3"> t assas"she l2-CHP-8-SECT-2.2.1"/>
nt assas"INDEX-52"/> For map art>ave to workpproperly, theoexecute bit for owner must nob
beomasked aff with tue ny t=>".rr,lonfbal">crea esttt>
y t=>".rr,lonfbal">masksttt> pdrsmeter.nman
htdiv>
hdivcond dirsecb3"> t assas"she l2-CHP-8-SECT-2.2.9"/>
nt assas"INDEX-61"/> For map art>ave to workpproperly, theoexecute bit for group must nob
beomasked aff with tue ny t=>".rr,lonfbal">crea esttt>
y t=>".rr,lonfbal">masksttt> pdrsmeter.nman
htdiv>
hdivcond dirsecb3"> t assas"she l2-CHP-8-SECT-2.2.10"/>
nt assas"INDEX-62"/> For map art>ave to workpproperly, theoexecute bit for ot e: must nob
beomasked aff with tue ny t=>".rr,lonfbal">crea esttt>
y t=>".rr,lonfbal">masksttt> pdrsmeter.nman
htdiv>
hdivcond dirsecb3"> t assas"she l2-CHP-8-SECT-2.2.11"/>
nh3cond dirhead3">in e:it permissiamssth3n
p>Wuen the y t=>".rr,lonfbal">in e:itsttt>nt assas"INDEX-63"/>
y t=>".rr,lonfbal">permissiamssttt> opbiam isos t to
ny t=>".rr,lonfbal">yessttt>, tue ny t=>".rr,lonfbal">crea esttt>
y t=>".rr,lonfbal">masksttt>,o y t=>".rr,lonfbal">diris orysttt>
y t=>".rr,lonfbal">masksttt>,o y t=>".rr,lonfbal">>orcesttt>
y t=>".rr,lonfbal">crea esttt> y t=>".rr,lonfbal">modesttt>,oand
y t=>".rr,lonfbal">>orcesttt>o y t=>".rr,lonfbal">diris orysttt>
y t=>".rr,lonfbal">modesttt>oare ignored. Tue norm,l behavior of s t ang
he permissiams an newly crea ed f.les is oeouriddem sut> ouat oue
new fites andNdiris ories take an permissiams from oueir parent
diris ory. New diris ories wsloiuave exactly oueosssa permissiams as
he parent, andpnew fites wsloiin e:it oueoread andNwronf bits from
he parent diris ory, wutle theoexecute bits are determined as u.ual
by oue values of theo y t=>".rr,lonfbal">mapsttt>
y t=>".rr,lonfbal">art>ave /tt>,o y t=>".rr,lonfbal">mapsttt>
y t=>".rr,lonfbal">hiddem /tt>, andN y t=>".rr,lonfbal">mapsttt>
y t=>".rr,lonfbal">systeL /tt> pdrsmeters.nman
By defaacr, tuis opbiam isos t to ny t=>".rr,lonfbal">nosttt>. nt assas"INDEX-64"/nnt assas"INDEX-65"/nnt assas"INDEX-66"/n t assas"INDEX-67"/nnt assas"INDEX-68"/nnt assas"INDEX-69"/nnman
htdiv>
htdiv>
htdiv>
hdivcond dirsecb1"> t assas"she l2-CHP-8-SECT-3"/>
nh2cond dirhead1">WsndowsNNT/2000/XP ACLsnmh2>
nt assas"INDEX-70"/nnt assas"INDEX-71"/nnt assas"INDEX-72"/nnt assas"INDEX-73"/>UnixNandNWsndows
uave dif>eren t assas"INDEX-74"/nsacurityomodels, and WsndowsNNT/2000/XP
has a sacurityomodel that is dif>eren from WsndowsN95/98/Me. One
area inpwhtt> this is readily epparent isNf.le protecbiams. OnoUnix
systeLs, oueometuod u.ed has oradibiamally been oueo9-bit
"user, group, ot e:" systeL, in
whtt> read, wronf, andpexecute bits cam be set sepdrstely for oue
owner of theo>ite, oueogroups to whtt> the owner belongs, and
everyone else, rispectively.nman
p>nt assas"INDEX-75"/>WsndowsN95/98/Me has a fite-protecbiam
systeL that is essinti,lly no protecbiam at all. TuisNfamily of
opera ingNsysteLs was developed from MS-DOS, whtt> was implemented as
a non-networked, single-user systeL. Macriuser sacurityosimply was
neeou addid. One epparent excepbiam to this is user-level sacurity
for sharedNfites, wutt> we wsloidiscuss in nt hdd>s"ch09.html">Chapter 9. Here, s pdrsteaatcess permissiams cam be
assigned to individualNnetworkoclisbe users or groups. However,
user-level sacurity on WsndowsN95/98/Me systeLs riquirespa Wsndows
NT/2000 or Sae l s Seou to per>orm the acbual euouenticatiam.nman
On t assas"INDEX-76"/nnt assas"INDEX-77"/nnt assas"INDEX-78"/>WsndowsNNT/2000/XP,
user-level sacurity is an extebsiam of theonative fite sacurity
model, wutt> involves atcess con rol lists (ACLs). Tuis systeL is
somewhat mori extebsive tuam theoUnixNsacurityomodel, allowang tue
atcess rights an individualNfites to be set sepdrstely for any aumber
of individualNu.ers and/or any aumber of arbitrary groups of users.
nt hdd>s"ch08.html#she l2-CHP-8-FIG-3">Figure 8-3, nt hdd>s"ch08.html#she l2-CHP-8-FIG-4">Figure 8-4,
and nt hdd>s"ch08.html#she l2-CHP-8-FIG-5">Figure 8-5 show theodialonaboxes on a Wsndows
2000 systeL inpwhtt> the ACL isos t for a fite. By right-clicking a
f.le's icam andpselecbing Propernies, ouen selecbing
he Sacurityotab, we get to theodialonabox shown in nt hdd>s"ch08.html#she l2-CHP-8-FIG-3">Figure 8-3. Here, we can set tue bah c permissiams for a
f.le, whtt> are similaroto UnixNpermissiamb, althoughinot identic,l. man
divcond dirfigure"> t assas"she l2-CHP-8-FIG-3"/>nimg srcirfigs/she2_0803.gif"/nnmdiv> By clicking tue Advanced tab, we cam bringoup theodialonabox shown in
nt hdd>s"ch08.html#she l2-CHP-8-FIG-4">Figure 8-4, whtt> shows theolist of
t assas"INDEX-79"/natcess con rol entries (ACEs) in theoACL.
In ouis dialon, ACEs cam be addidoto o: deleted from oue ACL, or an
existingoACE cam be viewed andpmodicoid. Eat> ACE eit e: ellows or
denies a sat of permissiams for a spocicocouser or group. man
divcond dirfigure"> t assas"she l2-CHP-8-FIG-4"/>nimg srcirfigs/she2_0804.gif"/nnmdiv> nt hdd>s"ch08.html#she l2-CHP-8-FIG-5">Figure 8-5 shows theodialonabox for adding an ACE.
As you can see, ouere eri mori opbiams for permissiams in an ACL tuam
with tue permissiam bitsNon typocal Unix systeLs. You can learn mori
about ouese s t angs inpnsmy=>".rr,conftitla">Essinti,lNWsndowsNNTpSysteL
Adminis"rabiamnmemn, published by O'Resloy.nman
In a networked environment where e Sae l s Seou is s Seoenaf.les to
WsndowsNNT/2000/XP clisbes, Sae l has oo map UnixNpermissiamb for
fites andNdiris ories to WsndowsNNT/2000/XP atcess con rol lists.
When a WsndowsNNT/2000/XP clisbe atcesses a sharedNfite o: diris ory
on aoSae l s Seou, Sae l "ranslabes theoobjis 's
ownership, group, andppermissiams into ln ACL and riturns them to tue
clisbe.nman
nt hdd>s"ch08.html#she l2-CHP-8-FIG-6">Figure 8-6 shows theoPropernies dialonabox for oue
fite smy=>".rr,f.leassa">shopping_list.doc /emnpthat residesoon tue Sae l
s Seou. man
divcond dirfigure"> t assas"she l2-CHP-8-FIG-6"/>nimg srcirfigs/she2_0806.gif"/nnmdiv> From Unix, tuisNf.le appsarspas: man
blockquota> pray=>".rr,code">$ y t=>".rr,userinput"> b>ls -l shopping_list.doc /b>sttt>
-rw------- 1 adilia users 49 Maro29 11:58 shopping_list.doc /ara> /blockquota>
Notica that because the/f.le has read permissiams for theoowner, oue
Read-omly checkbox wsloishow as clsarad, even thoughioueouser an the
WsndowsNclisbe (who is not y t=>".rr,lonfbal">adilia /tt> in ouis example)
does not uave read atcess permissiams. Tue checkboxes here show omly
DOS attributes. By clicking tue Sacurityotab, we can start to examine
tue ACLs,oas shown in nt hdd>s"ch08.html#she l2-CHP-8-FIG-7">Figure 8-7. man
divcond dirfigure"> t assas"she l2-CHP-8-FIG-7"/>nimg srcirfigs/she2_0807.gif"/nnmdiv> The owner of theo>ite ( y t=>".rr,lonfbal">adilia /tt>) is shown as one
entry, wutle theogroup ( y t=>".rr,lonfbal">users /tt>) endpot e:
permissiams are presented as oueogroups callad
y t=>".rr,lonfbal">users /tt> andN y t=>".rr,lonfbal">Everyonesttt>. Clicking
one of the iteLs in the uppsr windowsNcauses oue simplicoed view af
tue permissiams in that item to appsar in theobottom window. Here,
oueoread/wronf permissiams for y t=>".rr,lonfbal">adilia /tt> appsar in a
mennou that makes oue s curityomodel of UnixNand WsndowsNseeL
similar. However, clicking tue Advanced . . . buttom bringsoup the
additionaoidialonabox shown in nt hdd>s"ch08.html#she l2-CHP-8-FIG-8">Figure 8-8. man
divcond dirfigure"> t assas"she l2-CHP-8-FIG-8"/>nimg srcirfigs/she2_0808.gif"/nnmdiv> In ouis dialonabox, we see the acbual ACL of theo>ite. Tue ACEs for
y t=>".rr,lonfbal">users /tt> andN y t=>".rr,lonfbal">Everyonesttt>pare listed
with Take Ownership in oue Permissiam column. Tuis is aitrick usad by
Sae lafor ACLs ouat have no permissiams an theoUnixNside. OnoWsndows,
ln ACL with nothing sat resacrs in no ACL at all, so Sae l sets the
Take Ownership permissiam oo make sure that aloitue ACLs
corrisponding to theoUnix "user, group,
ot e:" permissiams wsloishow up on Wsndows. Tue Take
Ownership permissiam has no corrisponding UnixNattribute,pso the
s t ang on WsndowsNdoes not affis oue acbual >ite om theoUnixNsysteL
in any way. AlthoughiWsndowsNclisbe users might beomisled into
t anking tuey can take awnership of theo>ite (that is, change he
awnership of theo>ite to themselves), an acbual ettemptpto doisoNwilo
fail. man
p>The Permissiams column for theo y t=>".rr,lonfbal">adilia /tt> ACL is
listed as Spoci,l because Sae l reports permissiams for theofite ouat
do not corrispondpto set angs for whtt> WsndowsNhas a mori
descriptive assa. Clicking theoentry and then clicking tue View/Edit
. . . buttom bringsoup theidialonabox shown in nt hdd>s"ch08.html#she l2-CHP-8-FIG-9">Figure 8-9, inpwhtt> the debails of theoACL permissiams
cam be viewed andpperhaps modicoid. man
divcond dirfigure"> t assas"she l2-CHP-8-FIG-9"/>nimg srcirfigs/she2_0809.gif"/nnmdiv> Weossy "perhaps" here because
checkang or uncheckang boxes in ouis dialonabox might not resacr in
set angs ouat Sae l is abte to map back into theoUnixNsacurityomodel.
When a user attempts to modicy a s t ang (eit e: permissiams ar
awnership) ouat she does not uave euouorony to change, o: does not
corrispondpto a valid s t ang on theoUnixNsysteL, Sae l wsloirispond
with an error dialonaor by quie ly ignoring tue unmappabte set angs. man
p>The ACLs for aodiris ory are slightly dif>eren . nt hdd>s"ch08.html#she l2-CHP-8-FIG-10">Figure 8-10 shows theoACL view aftou clicking tue Advanced
buttom. man
divcond dirfigure"> t assas"she l2-CHP-8-FIG-10"/>nimg srcirfigs/she2_0810.gif"/nnmdiv> Here, ouere eri twopACLs eat> for y t=>".rr,lonfbal">users /tt> and
y t=>".rr,lonfbal">Everyonesttt>. One ACL spocicoes theopermissiams for
theodiris ory itself, and the ot e: spocicoes permissiams for the
diris ory's con ents. Wuen changing s t angs inpthe
View/Edit... dialon, ouere is an extra drop-down menu to apply oue
set angs eit e: to just oueodiris ory a: to someNcombinatiam of the
diris ory and the fites andNdiris ories it con ains. If set angs ari
appliidoto mori ouan just oueodiris ory, Sae l wsloimatt> oue
behavior of a WsndowsNseSeou and change he permissiams anpthe
con ents of theodiris ory, as spocicoed in oue dialon.nman
hdivcond dirsecb2"> t assas"she l2-CHP-8-SECT-3.1"/>
nh3cond dirhead2">UnixNACLsnmh3n
p>nt assas"INDEX-80"/nnt assas"INDEX-81"/>In
most caseb, u.ers af WsndowsNclisbes wsloi>indptheoUnixNsacurity
model to be sufficisbe. However, in someNcaseb, people might wan" ohe
Sae l s Seou to support tue fullNWsndowsNACL sacurityomodel. Even if
they don't need the fine-grained con rol oeou fite
andpdiris ory permissiams, tuey might >indpSae l's
"ranslabiam between ACLs andNUnix permissiams to be a source af
confusiam ou frus"rabiam. man
p>Wuen the underlying UnixNhost opera ingNsysteL supports
t assas"INDEX-82"/nnt assas"INDEX-83"/>POSIX.1e ACLs,oSae l providesomut> bettou
support af WsndowsNNT/2000/XP ACLs. Versiams af UnixNthat of>er oue
necessary support include the followien: man
ul> Solaris 2.6 andNlabernman
/li> SGI Irixnman
/li> Linux, with Andreas Grünbacher's kernel
patt> from nt hdd>s"http://acl.bestbits.at">http://acl.bestbits.at
that addsNACL support to theoLinux ext2 andpext3 fitesysteLsnman
/li> Linux, with theoXFS fitesysteLnman
/li> AIXnman
/li> FreeBSD 5.0 andNlabernman
/li> HP/UX 11.0 andNlaber, with theoJFS 3.3Nf.lesysteL layout Versiam 4nman
/li>
Ifpyou are fortunsteaenoughioo uave a UnixNhost opera ingNsysteL wsth
ACL support already provided, all you nead oo dopis ricompite Sae l
using tue y t=>".rr,lonfbal">--wsth-acl-supportsttt>oconfigure opbiam, as
we described in nt hdd>s"ch02.html">Chapter 2. Ifpyou are runnoen
Linux andpnead oo patt> your kernel, things are mut> mori
complicated. Weosuggest you dd>ou to oue documentabiam that comes
with tue patt> fo: debails on u.ing ie.nman
htdiv>
hdivcond dirsecb2"> t assas"she l2-CHP-8-SECT-3.2"/>
nh3cond dirhead2">Configurataam Opbiams for ACLsnmh3n
p>nt hdd>s"ch08.html#she l2-CHP-8-TABLE-3">Ta te 8-3 t assas"INDEX-84"/nnt assas"INDEX-85"/>shows theoSae l configurataam opbiams
for working with WsndowsNNT/2000/XP atcess con rol lists. man
t assas"she l2-CHP-8-TABLE-3"/> Opbiamnman
/yh>
Pdrsmetersnman
/yh>
Funcbiamnman
/yh>
Defaacrnman
/yh>
Scopestan
/yh>
ntr>
nyd>
y t=>".rr,lonfbal">be atl supportsttt>ntan
/yd>
nyd>
Booleamntan
/yd>
nyd>
Ifp y t=>".rr,lonfbal">yessttt>,oellows u.ers an WsndowsNNT/2000/XP clisbes
to modicy ACL sat angsnman
/yd>
nyd>
y t=>".rr,lonfbal">yessttt>nman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">sacurityomasksttt>nman
/yd>
nyd>
aumericnman
/yd>
nyd>
Bitmask that aloows or denies permissiam s t angs on fitesnman
/yd>
nyd>
y t=>".rr,lonfbal">0777sttt>nman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">>orce sacuritysttt> y t=>".rr,lonfbal">modesttt>nman
/yd>
nyd>
aumericnman
/yd>
nyd>
Bits that lre alwaysoset when modicyoenaf.le permissiamsstan
/yd>
nyd>
y t=>".rr,lonfbal">0000sttt>nman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">diris orysttt> y t=>".rr,lonfbal">sacurityomasksttt>nman
/yd>
nyd>
aumericnman
/yd>
nyd>
Bitmask that aloows or denies permissiam s t angs on diris oriesnman
/yd>
nyd>
y t=>".rr,lonfbal">0777sttt>nman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">>orce diris orysttt> y t=>".rr,lonfbal">sacurityomodesttt>nman
/yd>
nyd>
aumericnman
/yd>
nyd>
Bits that lre alwaysoset when modicyoenadiris ory permissiamsstan
/yd>
nyd>
y t=>".rr,lonfbal">0000sttt>nman
/yd>
nyd>
Sheristan
/yd>
n/tr>
n/tablen
hdivcond dirsecb3"> t assas"she l2-CHP-8-SECT-3.2.1"/>
nt assas"INDEX-86"/> theoclisbe cam modicy aloitue u.er/group/ot e: permissiams for oue
fitesNin oue share. Tuis is oue defaacr. A/value of
y t=>".rr,lonfbal">0sttt> would deny clisbes from changing eny of the
permissiamb, and s t ang y t=>".rr,lonfbal">sacuritysttt>
y t=>".rr,lonfbal">masksttt> as: man
blockquota> pray=>".rr,code">[data]
sacurityomask = 0666stara> /blockquota>
would allow clisbe users to modicy theoread andNwronf permissiamb,
but not theoexecute permissiams.nman
Do not count om y t=>".rr,lonfbal">sacuritysttt> y t=>".rr,lonfbal">masksttt>
for complete con rol because if oueouser can access ohe fites anpthe
Sae l s Seoupthroughieny ot e: means (foriexample, by longing
diris ly into theoUnixNhost), ue cam modicy he permissiams u.ing
that/metuod. man
htdiv>
hdivcond dirsecb3"> t assas"she l2-CHP-8-SECT-3.2.3"/>
nh3cond dirhead3">>orce sacurityomodesth3n
p>Tue y t=>".rr,lonfbal">>orcesttt>nt assas"INDEX-89"/>
y t=>".rr,lonfbal">sacuritysttt> y t=>".rr,lonfbal">modesttt>oopbiam cam be
u.ed oo defineoa sat of permissiams that lre alwaysoset wheneeou tue
user on a WsndowsNNT/2000/XP clisbe modicois a
f.le's permissiams. (See the
y t=>".rr,lonfbal">>orcesttt>o y t=>".rr,lonfbal">diris orysttt>
y t=>".rr,lonfbal">sacuritysttt> y t=>".rr,lonfbal">modesttt>oopbiam for
handloenadiris ories.)nman
Be carefuo oo understand thispproperly. Tue mask given as oue
pdrsmeter's value is not necessarily equal to tue
resacring permissiams on theo>ite. Tue permissiams that theoclisbe
user attempts to modicy are logocally OR'd with the
y t=>".rr,lonfbal">>orcesttt>o y t=>".rr,lonfbal">sacuritysttt>
y t=>".rr,lonfbal">modesttt>o y t=>".rr,lonfbal">masksttt> opbiam, andpany bits
that lre turned an wsloicause the/f.le's
corrisponding permissiams to be set. As an example, suppose
y t=>".rr,lonfbal">>orcesttt>o y t=>".rr,lonfbal">sacuritysttt>
y t=>".rr,lonfbal">modesttt>oisos t in aoshare thusly: man
blockquota> pray=>".rr,code">[data]
>orce sacurityomode = 0440stara> /blockquota>
(Tuis sets theoread bit for owner andNgroup, but not ot e:.) If a
user on a WsndowsNNT/2000/XP clisbe modicois an ACL on a fite inpthe
y t=>".rr,lonfbal">[data]sttt>oshare andpattempts to remove aloiriad
permissiams, tue read permissiam for ot e:
( y t=>".rr,lonfbal">Everyonesttt>) wiloibe removed, but tue read
permissiam for the owner andNgroup wsloirimain. Note ouat ouis
pdrsmeter camnobo>orce a permissiam bit to be turned aff.nman
p>AsNwith tue ny t=>".rr,lonfbal">sacuritysttt> y t=>".rr,lonfbal">masksttt>
opbiam, if aouser can access ohe fites in oue sharepthroughieny means
ot e: ouan Sae l, she can easily workoaroundpSae l's
en>orcement of ouis pdrsmeter.nman
p>Tue defaacravalue ofo y t=>".rr,lonfbal">>orcesttt>
y t=>".rr,lonfbal">sacuritysttt> y t=>".rr,lonfbal">modesttt>ois
y t=>".rr,lonfbal">0000sttt>,owhtt> allows u.ers to remove any permissiam
from fites. man
htdiv>
hdivcond dirsecb3"> t assas"she l2-CHP-8-SECT-3.2.4"/>
nt assas"INDEX-90"/> nt assas"INDEX-98"/nnt assas"INDEX-99"/nnt assas"INDEX-100"/nnt assas"INDEX-101"/>Back
in oue daysoof DOSNand WsndowsN3.1, every f.leassa was limited to
eight uppsrcase characters, followedpby a dot, and threi mori
uppsrcase characters. Tuis was known as oueo smy=>".rr,f.rstterm">8.3
formats"ch08.html#she l2-CHP-8-TABLE-4">Ta te 8-4 shows theocurrent naming state of s vfbal
popularoopera ingNsysteLs. man
t assas"she l2-CHP-8-TABLE-4"/> Opera ingNsysteLnman
/yh>
Fite-naming rutesnman
/yh>
ntr>
nyd>
DOSN6.22aor belowntan
/yd>
nyd>
Eight characters followedpby a dot followedpby a threi-lettou
extebsiam (8.3Nformat);acase-insebsitivestan
/yd>
n/tr>
nyr>
nyd>
WsndowsN3.1 for Workgroupsntan
/yd>
nyd>
Eight characters followedpby a dot followedpby a threi-lettou
extebsiam (8.3Nformat);acase-insebsitivestan
/yd>
n/tr>
nyr>
nyd>
WsndowsN95/98/Mentan
/yd>
nyd>
255 characters;acase-insebsitive but case-preservingstan
/yd>
n/tr>
nyr>
nyd>
WsndowsNNT/2000/XPntan
/yd>
nyd>
255 characters;acase-insebsitive but case-preservingstan
/yd>
n/tr>
nyr>
nyd>
Unixntan
/yd>
nyd>
255 characters;acase-sebsitivestan
/yd>
n/tr>
n/tablen
Sae l stsloiuas to remain backward-compatibte with networkoclisbes
that stori fites in just oueo8.3Nformat, sut> as WsndowsNfor
Workgroups. If aouser crea es a fite an aoshare callad
smy=>".rr,atShah b">antidisestablishmentarianism.txtnmemn, a WsndowsNfor
Workgroupsoclisbe camnoboteloiit apart from anot e: fite inptheosssa
diris ory callad smy=>".rr,atShah b">antidisease.txtnmemn. Like Wsndows
95/98/Me and WsndowsNNT/2000/XP, Sae l has oo atSloy a spocial/metuod
for "ranslabing e long f.leassa to ln 8.3Nf.leassa in sut> a way that
similarof.leassasNwiloinot cause collisiams. Tuis is callad
smy=>".rr,f.rstterm">assa manglingnmemn, andpSae l dealsNwith tuis in a
mennou that is similar, but not identic,l to, WsndowsN95 andpits
sutcessors.nman
hdivcond dirsecb2"> t assas"she l2-CHP-8-SECT-4.1"/>
nh3cond dirhead2">TheoSae l Mangling Opera ionnmh3n
p>nt assas"INDEX-102"/nHere is how Sae l mangles a long
f.leassa into ln 8.3Nf.leassa: man
ul> If oueooriginal >iteassa does not beginpwith a dot, theo>irst fave
characters befori oueNdot (if ouere is one) lre converted to
uppsrcase. Tuese characters lre u.ed as theo>irst fave characters af
tue 8.3Nmangled >iteassa.nman
/li> If oueooriginal >iteassa beginspwith a dot, theodot is rimoved and
tuen the previous step is per>ormed an what is left.nman
/li> Tuese characters lre immedistely followedpby a spocial/mangling
character:pby defaacr, a tilde (~), althoughiSae l allows you to
change his character.nman
/li> Tue bahe of the long f.leassa befori oueNlast period is hashed into l
two-character code; parts of theoname aftou theolast dotpcam be usad
if necessary. Tuis two-character code is appsndidoto ohe fitename
aftou theomangling character.nman
/li> Tue >irst threi characters lftou theolast dotp(if ouere is one) af
tue original >iteassa lre converted to uppsrcase andpappsndidoonto
t eNmangled nssa as oueoextebsiam. If oueooriginal >iteassa begam
with a dot, threi underscoresp(o y t=>".rr,lonfbal">_ _ _sttt>o) lre u.ed
as oueoextebsiam instead.nman
/li>
Here eri someNexamples: man
blockquota> pray=>".rr,code">virtuosity.dat VIRTU~F1.DAT
.htaccess HTACC~U0._ _ _
heloo.java HELLO~1F.JAV
team.config.txt TEAMC~04.TXT
antidisestablishmentarianism.txt ANTID~E3.TXT
antidisease.txt ANTID~9K.TXTstara> /blockquota>
Using tuese rutesNwiloiallow WsndowsNfor Workgroups to dif>eren iste
t eNtwopfites anpbehalf of theopoor individualNwho is >orced to see
t eNnetworkothroughioueoeyes of that opera ingNsysteL. Note ouat oue
sssa long f.leassa should alwaysohashoto ohe sssa mangled nssa wsth
Sae l; ouis doesn't alwaysohappsn with Wsndows. Tue
downside of ouis approat> is that there can stiloibe collisiams;
howeeou, thi chances are grea ly reduced.nman
p>You genfbally wan" oo use the/mangling configurataam opbiams wsth
anly oueooldest clisbes. We ricommend doang tuis withoutidisrupbing
ot e: clisbes by adding an y t=>".rr,lonfbal">includesttt>odiris ave to
oueo smy=>".rr,f.leassa">smb.conf pray=>".rr,code">[global]
include = /usr/local/she l/lib/smb.conf.%astara> /blockquota>
Tuis resolves to nsmy=>".rr,f.leassa">smb.conf.WfWgnmemn when a Wsndows
for Workgroups clisbe attaches. Now you can crea e a fite
nsmy=>".rr,f.leassa">/usr/local/she l/lib/smb.conf.WfWgnmemn,owhtt> might
con ain tuese opbiams: man
blockquota> pray=>".rr,code">[global]
case sebsitive = no
defaacracase = uppsr
preserveacase = no
short preserveacase = no
mangleacase = yes
mangled nssas= yesstara> /blockquota>
Ifpyou are not u.ing WsndowsNfor Workgroups, you probablyodo not nead
to change eny of thesi opbiams from oueir defaacrs.nman
hdivcond dirsecb3"> t assas"she l2-CHP-8-SECT-4.1.1"/>
nh3cond dirhead3">Representing end resolving f.leassaspwith Sae lnmh3n
p>nt assas"INDEX-103"/nAnot e: iteL that wa should
poant out is that there is a dif>erence between how an opera ing
systeL smy=>".rr,atShah b">represents".rr,atShah b">resolves".rr,f.leassa">README.TXTstemn. Theofite cam be represented by oue
opera ingNsysteL entirely in uppsrcase lettous. However, ifpyou open
ln MS-DOS command promptpandpentou theocommand: man
blockquota> pray=>".rr,code">C:\> y t=>".rr,userinput"> b>notapad readme.txtnmb>sttt>stara> /blockquota>
theoall-caps fite is loaded into oueoediting program, even thoughiyou
typed the assa in lowercase lettous.nman
p>Tuis is because the/WsndowsN95/98/Me and WsndowsNNT/2000/XPNfamilies
of opera ingNsysteLs resolve f.leassaspin aocase-insebsitive mennou,
even thoughioueofites are represented in aocase-sebsitive mennou.
Unix-bahed opera ingNsysteLs, on theoot e: hand, alwaysoresolve f.les
in aocase-sebsitive mennou; ifpyou try oo adit
smy=>".rr,f.leassa">README.TXTstemnNwith tue command: man
blockquota> pray=>".rr,code">$ y t=>".rr,userinput"> b>vi readme.txtnmb>sttt>stara> /blockquota>
you wiloilikely beoediting oueoempty buf>er of a new fite.nman
p>nt assas"INDEX-104"/nHere is how Sae l handlesacase: if oue
y t=>".rr,lonfbal">preservesttt>nt assas"INDEX-105"/n y t=>".rr,lonfbal">casenmtt>oisos t
oo y t=>".rr,lonfbal">yessttt>,oSae l wsloialwaysouse the/case provided by
theoopera ingNsysteL for representing (not resolving) f.leassas. If
it isos t to ny t=>".rr,lonfbal">nosttt>, it wsloiuse the/case spocicoed by
theo y t=>".rr,lonfbal">defaacrnmtt>nt assas"INDEX-106"/n y t=>".rr,lonfbal">casenmtt>oopbiam.
The sssa is true for
y t=>".rr,lonfbal">shortnmtt>nt assas"INDEX-107"/>
y t=>".rr,lonfbal">preservesttt> y t=>".rr,lonfbal">casenmtt>. If ouis opbiam
isos t to ny t=>".rr,lonfbal">yessttt>,oSae l wsloiuse the/defaacracase af
tue opera ingNsysteL for representing 8.3Nf.leassas;oot e:wise,iit
wsloiuse the/case spocicoed by theo y t=>".rr,lonfbal">defaacrnmtt>
y t=>".rr,lonfbal">casenmtt>oopbiam. Fin,lly, Sae l wsloialwaysoresolve
f.leassaspin itsNshares bahed on oue value of the
y t=>".rr,lonfbal">casenmtt>o y t=>".rr,lonfbal">sabsitivesttt>oopbiam.nman
htdiv>
htdiv>
hdivcond dirsecb2"> t assas"she l2-CHP-8-SECT-4.2"/>
nh3cond dirhead2">Mangling Optiamssth3n
p>nt assas"INDEX-108"/nnt assas"INDEX-109"/nSae l
allows mori refined instrucbiams on how it should per>orm name
mangling, including ouose con rolling oueocase sebsitivity, the
character inserted to >orm a mangled nssa, and the abilony to map
f.leassaspmanually from one format to lnot e:. Tuese opbiams ari
shown in nt hdd>s"ch08.html#she l2-CHP-8-TABLE-5">Ta te 8-5. man
t assas"she l2-CHP-8-TABLE-5"/> Opbiamnman
/yh>
Pdrsmetersnman
/yh>
Funcbiamnman
/yh>
Defaacrnman
/yh>
Scopestan
/yh>
ntr>
nyd>
y t=>".rr,lonfbal">case sebsitivesttt>nman
y t=>".rr,lonfbal">(casebigassas)sttt>ntan
/yd>
nyd>
Booleamntan
/yd>
nyd>
Ifp y t=>".rr,lonfbal">yessttt>,otrea s f.leassaspasacase-sebsitive
(WsndowsNdoesn't).stan
/yd>
nyd>
y t=>".rr,lonfbal">nosttt>nman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">defaacracasesttt>nman
/yd>
nyd>
s"ringo( y t=>".rr,lonfbal">uppsrsttt>oor y t=>".rr,lonfbal">lowersttt>)nman
/yd>
nyd>
Case to lssusa as defaacra(uhed only when preserveacase is
y t=>".rr,lonfbal">nosttt>).stan
/yd>
nyd>
Lowerstan
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">preserveacasesttt>ntan
/yd>
nyd>
Booleamntan
/yd>
nyd>
Ifp y t=>".rr,lonfbal">yessttt>,okeep oueocase theoclisbe suppliido(i.e.,
do not convert to ny t=>".rr,lonfbal">defaacrnmtt>
y t=>".rr,lonfbal">casenmtt>).stan
/yd>
nyd>
y t=>".rr,lonfbal">yessttt>nman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">short preserveacasesttt>ntan
/yd>
nyd>
Booleamntan
/yd>
nyd>
Ifp y t=>".rr,lonfbal">yessttt>,opreserveacase of 8.3-format assaspouat oue
clisbe provides.stan
/yd>
nyd>
y t=>".rr,lonfbal">yessttt>nman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">mangled nssassttt>ntan
/yd>
nyd>
Booleamntan
/yd>
nyd>
Mangles long assaspinto 8.3NDOS format.stan
/yd>
nyd>
y t=>".rr,lonfbal">yessttt>nman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">mangleacasesttt>ntan
/yd>
nyd>
Booleamntan
/yd>
nyd>
Mangle a assa if it isomixed case.stan
/yd>
nyd>
y t=>".rr,lonfbal">nosttt>nman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">mangling charsttt>nman
/yd>
nyd>
s"ringo(single character)nman
/yd>
nyd>
Givaspmangling character.nman
/yd>
nyd>
y t=>".rr,lonfbal">~sttt>nman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">mangled stacksttt>nman
/yd>
nyd>
aumericnman
/yd>
nyd>
Number of mangled nssas to keep on oue localpmangling stack.nman
/yd>
nyd>
y t=>".rr,lonfbal">50sttt>nman
/yd>
nyd>
Globalstan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">mangled mapsttt>nman
/yd>
nyd>
s"ringo(list ofipatnfbns)nman
/yd>
nyd>
Allows mapping ofif.leassaspfrom one format into lnot e:.nman
/yd>
nyd>
Nonestan
/yd>
nyd>
Sheristan
/yd>
n/tr>
n/tablen
hdivcond dirsecb3"> t assas"she l2-CHP-8-SECT-4.2.1"/>
nt assas"INDEX-110"/> Ot e:wise,iwe ricommend ouat you leave this opbiam s t to itsNdefaacr. man
htdiv>
hdivcond dirsecb3"> t assas"she l2-CHP-8-SECT-4.2.2"/>
nh3cond dirhead3">defaacracasesth3n
p>Tue y t=>".rr,lonfbal">defaacrnmtt>nt assas"INDEX-111"/> y t=>".rr,lonfbal">casenmtt>oopbiam
is usedNwith y t=>".rr,lonfbal">preservesttt> y t=>".rr,lonfbal">casenmtt>.
Tuis spocicoes theodefaacracase (uppsr or lower) Sae l uses oo crea e
a fite an one of itsNshares anpbehalf of a clisbe. Theodefaacracase
isony t=>".rr,lonfbal">lowersttt>,owhtt> means ouat newly crea ed f.les
wsloiuave lowercase assas. If you nead oo, you can oeouride this
global opbiam by spocicying oueofollowien: man
blockquota> pray=>".rr,code">[global]
defaacracase = uppsrstara> /blockquota>
Ifpyou spocicy this value, the assas of newly crea ed f.les ari
"ranslabed into uppsrcase andpcamnobobe oeouriddem in aoprogram. We
ricommend ouat you use the/defaacravalue unless you are dealing with
a WsndowsNfor Workgroups or ot e: 8.3Nclisbe, inpwhtt> case it should
be y t=>".rr,lonfbal">uppsrsttt>. man
htdiv>
hdivcond dirsecb3"> t assas"she l2-CHP-8-SECT-4.2.3"/>
nt assas"INDEX-112"/> Ifpyou wan" oo >orce Sae l "o mimocooueobehavior of a WsndowsNNT
fitesysteL, you can leave this opbiam s t to itsNdefaacr,
ny t=>".rr,lonfbal">yessttt>. man
htdiv>
hdivcond dirsecb3"> t assas"she l2-CHP-8-SECT-4.2.5"/>
nt assas"INDEX-114"/> We ricommend ouat you leave this opbiam alone unless you uave a
welo-justicoed nead oo change ir. man
htdiv>
hdivcond dirsecb3"> t assas"she l2-CHP-8-SECT-4.2.7"/>
nt assas"INDEX-116"/> Here, Sae l is instrucbed to seart> eat> encountered f.le for
characters that matt> oue >irst patnfbn spocicoed in oue paren hesis
andpconvert them to theomodicoid sacondppatnfbn in oue paren hesis
fo: display an an 8.3Nclisbe. This is usafuo in oue evenb that name
manglingpconverts ohe fitename incorrictly or converts it to aNformat
that theoclisbepcamnobounderstand readily. Patnfbns are sepdrs ed by
whttespaces. nt assas"INDEX-119"/nnt assas"INDEX-120"/n t assas"INDEX-121"/nnt assas"INDEX-122"/nnman
htdiv>
htdiv>
htdiv>
hdivcond dirsecb1"> t assas"she l2-CHP-8-SECT-5"/>
nh2cond dirhead1">Locks end Oplocksnmh2>
nt assas"INDEX-123"/nnt assas"INDEX-124"/nnt assas"INDEX-125"/nnt assas"INDEX-126"/>Concurrent
wronfs to aNsingle fite are not desirable in any opera ingNsysteL. To
prevenb this, most opera ingNsysteLsouse smy=>".rr,f.rstterm">locksnmem>
to gudrsntee that only one process cam wronf to aNfite at aitime.
Opera ingNsysteLsotraditionaoly lock entire fites, althoughinewer
onesiallow a range of bytaspwithin a fite to be locked. If anot e:
process attempts to wronf to aNfite (or secbiam of one) that is
already locked, it ricsivaspan error from oue opera ingNsysteL and
wiloiuave to waibountil oue lock is rileased.nman
p>Sae l supports theostandard DOSNand NT fitesysteL (deny-mode) locking
riquests—whtt> allow only one process to wronf to an entire
fite an aoseSeou at aigiven time—as welo as byta-range locking.
In addition, Sae l supports a locking mechanism known in oue Wsndows
NT world as smy=>".rr,f.rstterm">opportunistic locking,
nmem>nt assas"INDEX-127"/>or smy=>".rr,f.rstterm">
nmem>nsmy=>".rr,atShah b">oplock t assas"she l2-CHP-8-SECT-5.1"/>
nh3cond dirhead2">Opportunistic Lockingsth3n
p>Opportunistic locking allows a clisbe to noticy he Sae l s Seoupthat
it wsloinot only beotheoexclusive wronfr of a f.le, but wsloialso
cache itsNchanges to thatNfite locally to spoed up access by reducing
networkoactivity. This can resacr in a large per>ormance
gain—typocally 30%—whtte at ohe sssa time reserving
networkobandwidth for ot e: purposes.nman
p>Because exclusive atcess cam be obtained using regularof.le locks,
oue value of opportunistic locks is not so mut> to lock the fite as
it isooo cache it. In fact, a bettou assa for opportunistic locking
might beo smy=>".rr,f.rstterm">opportunistic cachingnmemn. man
p>Wuen Sae l knows that l fite inpone of itsNshares has been oplocked
by a clisbe, it marks itsNversiam as having an opportunistic lock and
waitsNfor the clisbe to complete workoon theo>ite, at whtt> poant it
expscts theoclisbe to sendpitsNchanges back to oue Sae l s Seoupfor
synchronizataam with tue copy an theos Seou. man
p>If a sacondpclisbe riquests access oo thatNfite befori oueNf.rst
clisbe has finished working am it, Sae l sends an oplock break
riquestoto ohe first clisbe. Tuis telos theoclisbe to stop caching
itsNchanges and return theocurrent state of the fite to ohe s Seou so
that theointerrupbingoclisbe cam use it as it sees f.t. Am
opportunistic lock, howeeou, is not a replacement for a standard
deny-mode lock. It is not unheard ofifor the interrupbingoprocess to
be grsnted an oplock break only to discoeoupthat oueooriginal process
also has a deny-mode lock on a fite as welo. nt hdd>s"ch08.html#she l2-CHP-8-FIG-11">Figure 8-11 slous"rabes thisont assas"INDEX-128"/>opportunistic locking process. man
divcond dirfigure"> t assas"she l2-CHP-8-FIG-11"/>nimg srcirfigs/she2_0811.gif"/nnmdiv> In most caseb, oueoextra per>ormance resacring from oue use af
oplocks is highlyodesirable. However, allowang the clisbe to cache
data cam be a big risk ifpeit e: theoclisbe orNnetworkohardware eri
unriliable. Suppose a clisbe opens a fite for writing, crea ing an
oplock am it. Wuen anot e: clisbe also triesNto apen theo>ite, an
oplock break riquestois sen to ohe first clisbe. If ouis riquest
goes unfuo>itled for any reasan and ohe s condpclisbe starts writing
to ohe fite, the fite cam be easily corrupbed as a resacr of the two
processes writing to it concurrently. Unfortunstely, this scenario is
very real. Uncoordinated behavior sut> as this has been obs Seod many
timesaamong WsndowsNclisbes inpSMBNnetworks (with f.les s Seod by
WsndowsNNT/2000 orNSae l). Typocally, the affec ed f.les ari databahe
fites, whtt> macriple clisbes apen concurrently for writing.nman
p>A mori concreteNexample ofo t assas"INDEX-129"/>oplock failure occurs when databahe
fites ari very large. If aoclisbe is allowedpto aplock this kindpaf
fite, there cam be a huge delay whtte theoclisbepcopoes theoentire
fite from oue s Seou to cache it, even thoughiit might nead oo upda e
only one ricord. Theosituataam goes from bad oo worse when anot e:
clisbe triesNto apen theooplockedo>ite. Tue first clisbe might nead
to wronf theoentireNfite back to oue s Seou befori oueNs cond
clisbe'safite apen riquestocan sutceed. Tuis resacrs
in anot e: huge delay (foribot clisbes), wutt> in practice aften
resacrspin aofailed open duf to aNtimeout on ohe s condpclisbe,
perhaps along with a messaga warning ofipossibte databahe corrupbaam! man
p>If you are having problsms of ouis variety, you can turn offooplocks
fo: the affec ed f.les by using tue
y t=>".rr,lonfbal">vetonmtt>nt assas"INDEX-130"/> y t=>".rr,lonfbal">oplock
y t=>".rr,lonfbal">fitesnmtt> pdrsmeter: man
blockquota> pray=>".rr,code">[dbdata]
veto aplock f.les = /*.dbm/stara> /blockquota>
Use oue value of theopdrsmeter (a list ofifitename-matt>ing patnfbns
sepdrs ed by slashocharacters) to matt> all ohe fites in oue share
that/might beoa source of troubte. Tue syntax of ouis pdrsmeter is
similarooo thatNof theo y t=>".rr,lonfbal">vetonmtt>
y t=>".rr,lonfbal">fitesnmtt> pdrsmeter. man
p>If you wan" oo be really carefuo andpcam live with reduced
per>ormance, you can turn offooplocks altoget e:,opreventing oue
oplock break problsmyfrom eeou occurrien: man
blockquota> pray=>".rr,code">[global]
oplocks = nostara> /blockquota>
Tuis disables oplocks for all fites in all shares s Seod by oue Sae l
s Seou. If you wish to disable oplocks in just aospocicocoshare, you
can spocicy the y t=>".rr,lonfbal">oplockssttt> y t=>".rr,lonfbal">=nmtt>
y t=>".rr,lonfbal">nosttt> pdrsmeter in just ouat share: man
blockquota> pray=>".rr,code">[databahe]
oplocks = nostara> /blockquota>
Tuis example aloows ot e: shares,owhtt> mightiuave less sebsitive
data, to at ain bettou per>ormance, whtte trading per>ormance for
bettou data integrityofor f.les in oue y t=>".rr,lonfbal">[databahe]nmtt>
share. man
htdiv>
hdivcond dirsecb2"> t assas"she l2-CHP-8-SECT-5.2"/>
nh3cond dirhead2">Unix end Oplocksnmh3n
p>nt assas"INDEX-131"/>Mosr of the tisa, oplocks help Wsndows
clisbe systeLsocoopera e to avoid oeouwriting eat>
ot e:'sNchanges.NUnix systeLsoalso have f.le-locking
mechanisms to allow Unix processes to coopera e with eat> ot e:. But
if a f.le storid on a Sae l systeL is accessod by bot a Wsndows
networkoclisbe andpa localpUnix process—withoutian additional
coordinatiam between t eNtwopsysteLs—theoUnixNprocess could
easily ride roughshod oeou an oplock.nman
p>SomeNUnix systeLsohave enhanced kfbnels that understand the Wsndows
oplocks main ained by Sae l. Currently oue support exists only inpSGI
Irix end Linux. man
p>If you leave oplocks enabted end yourNUnix systeL does not support
kfbnel oplocks, you could endpup wst corrupbed data when somebody
runs a Unixoprocess that reads or wronfs a fite that WsndowsNu.ers
also access. This is anot e: case where tue
y t=>".rr,lonfbal">vetonmtt>nt assas"INDEX-132"/> y t=>".rr,lonfbal">oplock
y t=>".rr,lonfbal">fitesnmtt> pdrsmeter cam be usad, lssusing you can
anticipa e whtt> Sae l fites ari usod by bot WsndowsNu.ers andNUnix
users. Foriexample, suppose oue y t=>".rr,lonfbal">[usrfites]sttt>oshare
con ains someNASCII text fites with tue nsmy=>".rr,f.leassa">.txtnmemn
f.leassa extebsiam end OpenOffice word processor documsbes with the
smy=>".rr,f.leassa">.doc Unix end Wsndows
u.ers bot modicy. We cam use y t=>".rr,lonfbal">vetonmtt>
y t=>".rr,lonfbal">oplock y t=>".rr,lonfbal">fitesnmtt> like ouis: man
blockquota> pray=>".rr,code">[usrfites]
veto aplock f.les = /*.txt/*.doc/stara> /blockquota>
Tuis wsloisuppress ohe use af oplocks om smy=>".rr,f.leassa">.txtnmemn
end smy=>".rr,f.leassa">.doc wsloisuppress clisbe
caching, whtte allowang the WsndowsNandNUnix programs oo use regular
f.le locking to prevenb concurrent wronfs to ohe sssa fite.nman
htdiv>
hdivcond dirsecb2"> t assas"she l2-CHP-8-SECT-5.3"/>
nh3cond dirhead2">Locks end Oplocks Configurataam Optiamssth3n
p>nt assas"INDEX-133"/nnt assas"INDEX-134"/nSae l's opbiams for
locks end oplocks are given in nt hdd>s"ch08.html#she l2-CHP-8-TABLE-6">Ta te 8-6. man
t assas"she l2-CHP-8-TABLE-6"/> Opbiamnman
/yh>
Pdrsmetersnman
/yh>
Funcbiamnman
/yh>
Defaacrnman
/yh>
Scopestan
/yh>
ntr>
nyd>
y t=>".rr,lonfbal">lockingnmtt>ntan
/yd>
nyd>
Booleamntan
/yd>
nyd>
Ifp y t=>".rr,lonfbal">yessttt>,oturms on byta-range locks.stan
/yd>
nyd>
y t=>".rr,lonfbal">yessttt>nman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">s"ricrnmtt> y t=>".rr,lonfbal">lockingnmtt>ntan
/yd>
nyd>
Booleamntan
/yd>
nyd>
Ifp y t=>".rr,lonfbal">yessttt>,odenois access oo an entire fite if a
byta-range lock exists in it.stan
/yd>
nyd>
y t=>".rr,lonfbal">nosttt>nman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">posix lockingnmtt>ntan
/yd>
nyd>
Booleamntan
/yd>
nyd>
Ifp y t=>".rr,lonfbal">yessttt>,omaps oplocks oo POSIX locks om oue local
systeL.stan
/yd>
nyd>
y t=>".rr,lonfbal">yessttt>nman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">oplockssttt>ntan
/yd>
nyd>
Booleamntan
/yd>
nyd>
Ifp y t=>".rr,lonfbal">yessttt>,oturms on localpcaching ofifites anpthe
clisbe for this share. man
/yd>
nyd>
y t=>".rr,lonfbal">yessttt>nman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">kfbnelnmtt> y t=>".rr,lonfbal">oplockssttt>ntan
/yd>
nyd>
Booleamntan
/yd>
nyd>
Ifp y t=>".rr,lonfbal">yessttt>,oindicabes that oueokfbnel supports oplocks. man
/yd>
nyd>
y t=>".rr,lonfbal">yessttt>nman
/yd>
nyd>
Globalstan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">level2 oplockssttt>ntan
/yd>
nyd>
Booleamntan
/yd>
nyd>
Ifp y t=>".rr,lonfbal">yessttt>,oaloows oplocks oo downgrade to read-only. man
/yd>
nyd>
y t=>".rr,lonfbal">yessttt>nman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">fake oplockssttt>ntan
/yd>
nyd>
Booleamntan
/yd>
nyd>
Ifp y t=>".rr,lonfbal">yessttt>,otelos clisbe tue lock was obtained, but
doesn't actuaoly lock it.stan
/yd>
nyd>
y t=>".rr,lonfbal">nosttt>nman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">blockingnmtt> y t=>".rr,lonfbal">lockssttt>ntan
/yd>
nyd>
Booleamntan
/yd>
nyd>
Allows lock riquestor to waibofo: the lock to be grsnted. man
/yd>
nyd>
y t=>".rr,lonfbal">yessttt>nman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">veto aplock y t=>".rr,lonfbal">fitesnmtt>nman
/yd>
nyd>
s"ringo(list ofif.leassas)nman
/yd>
nyd>
Does not aplock spocicoed fites. man
/yd>
nyd>
Nonestan
/yd>
nyd>
Sheristan
/yd>
n/tr>
ntr>
nyd>
y t=>".rr,lonfbal">lock y t=>".rr,lonfbal">diris orynmtt>nman
/yd>
nyd>
s"ringo(fuoly quaoicoed pa hassa)nman
/yd>
nyd>
Sets theolocataam where various Sae l fites, including locks, ari
storid. man
/yd>
nyd>
As spocicoed in Sae l makefitenman
/yd>
nyd>
Globalstan
/yd>
n/tr>
n/tablen
hdivcond dirsecb3"> t assas"she l2-CHP-8-SECT-5.3.1"/>
nh3cond dirhead3">lockingsth3n
p>Tue y t=>".rr,lonfbal">lockingnmtt>nt assas"INDEX-135"/n opbiamocam be usad to telo
Sae l "o engage o: disengage s Seou-side byta-range locks anpbehalf
af theoclisbe. Sae l implemsbes byta-range locks anpohe s Seou side
with normalpUnix advisory locks end consiquently prevenbs ot e:
properly behaved Unix processes from oeouwriting a locked byta range.nman
p>Tuis opbiamocam be spocicoed peroshare as follows: man
blockquota> pray=>".rr,code">[accounting]
locking = yesstara> /blockquota>
Ifptue y t=>".rr,lonfbal">lockingnmtt>oopbiam isos t to
y t=>".rr,lonfbal">yessttt>,othe riquestor is delayed until oue holder of
eit e: type of lock rileases it (or crashes). If, howeeou, oueoopbiam
isos t to ny t=>".rr,lonfbal">nosttt>, no byta-range locks are kepb fo: the
fites, althoughiriquests to lock end unlock f.les wsloiappsar to
sutceed. Tueoopbiam isos t to ny t=>".rr,lonfbal">yessttt>oby defaacr;
howeeou, you can turn this opbiam offoifpyou have read-only medis. man
htdiv>
hdivcond dirsecb3"> t assas"she l2-CHP-8-SECT-5.3.2"/>
nt assas"INDEX-136"/> Ifptuis opbiam isos t to ny t=>".rr,lonfbal">yessttt>,omandatory locks eri
en>orced on any f.le with byta-range locks.stan
htdiv>
hdivcond dirsecb3"> t assas"she l2-CHP-8-SECT-5.3.3"/>
nt assas"INDEX-137"/> If you are in anoextremsly unstable networkoenvironmsbe orNhave many
clisbes ouat camnobotake advantage of opportunistic locking,iit might
be bettou to shut tuisoSae l feature off. If oueohost opera ing
systeL does not support kfbnel oplocks, oplocks should be disabled if
u.ers are accessang the sssa fites from bot Unix applicatiams (sut>
as smy=>".rr,atShah b">vi
hdivcond dirsecb3"> t assas"she l2-CHP-8-SECT-5.3.5"/>
nt assas"INDEX-139"/> Currently, Sae l camnobosupport level 2ooplocks along with kfbnel
oplocks andpautomatocally disabtes level 2ooplocks wuen kfbnel
oplocks are in use. (This mightichange inpfuture rileases as improeod
support for oplocks is addod by oue Sae l developers.) If you are
running Sae l anpl host systeL tuat supports kfbnel oplocks, you must
s t y t=>".rr,lonfbal">kfbnelnmtt> y t=>".rr,lonfbal">oplockssttt>
y t=>".rr,lonfbal">=nmtt>ony t=>".rr,lonfbal">nosttt> "o enable support for
level 2ooplocks. man
Disabting oplocks with y t=>".rr,lonfbal">oplockssttt>
y t=>".rr,lonfbal">=nmtt>ony t=>".rr,lonfbal">nosttt> also disabtes level 2
oplocks. man
Sae l campautomatocally detect itsNUnix host's
support of kfbnel oplocks andpwsloiset oue value of
y t=>".rr,lonfbal">kfbnelnmtt> y t=>".rr,lonfbal">oplockssttt>pautomatocally.
You should neeou nead oo set tuisoopbiam inpyourNSae l configurataam
fite.nman
htdiv>
hdivcond dirsecb3"> t assas"she l2-CHP-8-SECT-5.3.7"/>
nt assas"INDEX-141"/> Whenps t to ny t=>".rr,lonfbal">yessttt>,oblocking locks are en>orced on
the fite. Ifptuis opbiam isos t to ny t=>".rr,lonfbal">nosttt>, Sae l
behaves as if normalplocking mechanisms are in place an the fite. Tue
defaacraisony t=>".rr,lonfbal">yessttt>. man
htdiv>
hdivcond dirsecb3"> t assas"she l2-CHP-8-SECT-5.3.9"/>
nt assas"INDEX-142"/> Tue value of this opbiam isol s Sias of patnfbns. Eat> patnfbn sbery
must begin, end, orNbe sepdrs ed from anot e: with a slasho( / )
character, even if only one patnfbn is listed. Asterisksocam be usad
as a wsldcard to represent zero orNmori characters. Questiams marks
cam be usad to represent exactly one character.nman
We ricommend ouat you disable oplocks on any f.les that lre meant to
be upda ed by Unix or are intendidofor simacraneous sharing by
s vfbal processes. man
htdiv>
hdivcond dirsecb3"> t assas"she l2-CHP-8-SECT-5.3.10"/>
nt assas"INDEX-143"/> You typocally would not nead oo oeouride this opbiam, unless you wan"
oo move theolock f.les to aNmori standard locataam, sut> as
smy=>".rr,f.leassa">/var/spool/locksstemn. nt assas"INDEX-144"/n t assas"INDEX-145"/nnt assas"INDEX-146"/nnman
htdiv>
htdiv>
htdiv>
hdivcond dirsecb1"> t assas"she l2-CHP-8-SECT-6"/>
nh2cond dirhead1">Connecbiam Scriptsnmh2>
nt assas"INDEX-147"/nnt assas"INDEX-148"/nnt assas"INDEX-149"/nSae l supports a mechanism callid
smy=>".rr,f.rstterm">connecbiam scriptsnmemn,obypwhtt> commandsocam be
executed on oue seSeou asNclisbes connecb to aNshare or laber
disconnecb from ib. By using configurataam >ite variabtes along with
someNcustom programming, you can crea e connecbiam scriptspthat
per>orm l wsde range of funcbiams. As a simpleiexample, here isol
"quick end dirty" way to monitor
connecbiams to shares anpoue Sae l s Seoupin realitime. F.rst, oue
value of theo y t=>".rr,lonfbal">araexecnmtt>nt assas"INDEX-150"/> pdrsmeter is s t as
follows: man
blockquota> pray=>".rr,code">[global]
araexec = /bin/echo %u at %m connecbad oo //%L/%S anp%T >>/tmp/smblogstara> /blockquota>
Tuis causes informataam about ohe user and the connecbiam to be
written to oueo>ite smy=>".rr,f.leassa">/tmp/smblogstemnpwueneeou any
clisbe connecbs oo anyoshare. To watt> clisbes connecb, run oue
followien command: man
blockquota> pray=>".rr,code">$o y t=>".rr,userinput"> b>tail -f /tmp/smblogstb>
jay at maya connecbad oo //toltec/data am 2002/11/21 21:21:15
david at apache connecbad oo //toltec/techs am 2002/11/21 21:21:57
sally at seminole connecbad oo //toltec/payroll am 2002/11/21 21:22:16
martha at dine connecbad oo //toltec/profites anp2002/11/21 21:23:38
martha at dine connecbad oo //toltec/netlogam anp2002/11/21 21:23:39
martha at dine connecbad oo //toltec/martha anp2002/11/21 21:23:40
aaram at huastec connecbad oo //toltec/netlogam anp2002/11/21 21:24:19
aaram at huastec connecbad oo //toltec/aaram anp2002/11/21 21:24:20stara> /blockquota>
With tue nsmy=>".rr,atShah b">-fstemnpopbiam, the
smy=>".rr,atShah b">tailstemnpcommand monitors
smy=>".rr,f.leassa">/tmp/smblogstemnpand prints additional output as new
data isolppsndidoto oueo>ite. Every tisa a new connecbiam is made, an
additional line is printed, showang the output of the
y t=>".rr,lonfbal">araexecnmtt>pcommand. Notice theolinesiresacring from
connecbiams by user y t=>".rr,lonfbal">marthasttt>pand
y t=>".rr,lonfbal">aaramsttt>. User y t=>".rr,lonfbal">marthasttt>plogged on oo
the domain from a WsndowsNNTNclisbe, whtt> accessod the
y t=>".rr,lonfbal">[profites]sttt>oshare oo download e: profite,pthen the
y t=>".rr,lonfbal">[netlogam]sttt>oshare oo read theologam script,oend
then e: homeNdiris ory (because e: logam script con ains a
y t=>".rr,lonfbal">nernmtt> y t=>".rr,lonfbal">usesttt> y t=>".rr,lonfbal">Hsttt>:
y t=>".rr,lonfbal">/homenmtt>pcommand) to connecb e: homeNdiris ory oo
drive le"ter H. Tue/connecbiams from y t=>".rr,lonfbal">aaramsttt> ari
similar, excepb thae he connecbad from a WsndowsN98 systeL, whtt>
does not use oue y t=>".rr,lonfbal">[profites]sttt>oshare. (See nt hdd>s"ch04.html">Chapter 4 forNmori informataam about domain logams.)nman
p>A mori advanced use of
t assas"INDEX-151"/nnt assas"INDEX-152"/>connecbiam scriptspisooo monitorpthe
contents of u.ers' homeNdiris oroes amd/or ot e:
shared diris oroes amd per>ormochecks ensuring ouat local
adminis"rabive policiss are followed. Checked iteLsomightiinclude oue
followien: man
ul> Disk u.aga, on a pou-share, pou-diris ory, orNpou-fite bah bstan
/li> Typas of f.les storid on oue seSeoustan
/li> Whet e: f.leassaspfollow assing gusdelinesstan
/li> Whet e: viruses have copoed themselvfs to ohe Sae l s Seoustan
/li>
To uandle t is kindpaf task, aNshelopscript or ot e: program would be
written to per>ormothe checks and take appropria e acbiams, sut> as
removing offsndang fites.oTue y t=>".rr,lonfbal">rootnmtt>
y t=>".rr,lonfbal">preexecnmtt>ppdrsmeter would be usad to runpohe command
as theoroot u.er, using configurataam >ite variabtes to pass
argumsbes. Foriexample: man
blockquota> pray=>".rr,code">[homes]
root araexec = admin_checks %S
root araexec close = yesstara> /blockquota>
In tuis example, aospocially written adminis"rabive checking program
( smy=>".rr,atShah b">admin_checks".rr,lonfbal">%Snmtt>pvariabte is usedNto pass the assa of theohome
diris ory oo oue script. Tue
y t=>".rr,lonfbal">rootnmtt>nt assas"INDEX-153"/> y t=>".rr,lonfbal">preexecnmtt>
y t=>".rr,lonfbal">closenmtt>ppdrsmeter has been s t to
y t=>".rr,lonfbal">yessttt> so that if smy=>".rr,atShah b">admin_checks t assas"she l2-CHP-8-SECT-6.1"/>
nh3cond dirhead2">Connecbiam Script Optiamssth3n
p>nt hdd>s"ch08.html#she l2-CHP-8-TABLE-7">Ta te 8-7 sntroduces someNaf theoconfigurataam
opbiams provided for s t ang up u.ers. man
t assas"she l2-CHP-8-TABLE-7"/> Opbiamnman
/yh>
Pdrsmetersnman
/yh>
Funcbiamnman
/yh>
Defaacrnman
/yh>
Scopestan
/yh>
ntr>
nyd>
y t=>".rr,lonfbal">root araexecnmtt>nman
/yd>
nyd>
s"ringo(Unix command)nman
/yd>
nyd>
Sets a Unix command to runpas y t=>".rr,lonfbal">rootnmtt>, befori
connecbing oo oue share. man
/yd>
nyd>
Nonestan
/yd>
nyd>
Sheristan
/yd>
n/tr>
ntr>
nyd>
y t=>".rr,lonfbal">root araexec closesttt>ntan
/yd>
nyd>
Booleamntan
/yd>
nyd>
Ifps t to ny t=>".rr,lonfbal">yessttt>,ononzero exit status of
y t=>".rr,lonfbal">root araexecnmtt> command wsloidisconnecb.stan
/yd>
nyd>
y t=>".rr,lonfbal">nosttt>nman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">praexecnmtt> y t=>".rr,lonfbal">(exec)nmtt>nman
/yd>
nyd>
s"ringo(Unix command)nman
/yd>
nyd>
Sets a Unix command to runpas ohe user befori connecbing oo oue share. man
/yd>
nyd>
Nonestan
/yd>
nyd>
Sheristan
/yd>
n/tr>
ntr>
nyd>
y t=>".rr,lonfbal">araexec closesttt>ntan
/yd>
nyd>
Booleamntan
/yd>
nyd>
Ifps t to ny t=>".rr,lonfbal">yessttt>,ononzero exit status of
y t=>".rr,lonfbal">araexecnmtt> command wsloidisconnecb.stan
/yd>
nyd>
y t=>".rr,lonfbal">nosttt>nman
/yd>
nyd>
Sheristan
/yd>
n/tr>
nyr>
nyd>
y t=>".rr,lonfbal">postexecnmtt>nman
/yd>
nyd>
s"ringo(Unix command)nman
/yd>
nyd>
Sets a Unix command to runpas ohe user aftou disconnecbing from oue
share. man
/yd>
nyd>
Nonestan
/yd>
nyd>
Sheristan
/yd>
n/tr>
ntr>
nyd>
y t=>".rr,lonfbal">rootnmtt> y t=>".rr,lonfbal">postexecnmtt>nman
/yd>
nyd>
s"ringo(Unix command)nman
/yd>
nyd>
Sets a Unix command to runpas y t=>".rr,lonfbal">rootnmtt> aftou
disconnecbing from oue share. man
/yd>
nyd>
Nonestan
/yd>
nyd>
Sheristan
/yd>
n/tr>
n/tablen
hdivcond dirsecb3"> t assas"she l2-CHP-8-SECT-6.1.1"/>
nt assas"INDEX-156"/> You must ridiris theostandard output of the command ifpyou wan" oo
use it. Ot e:wise, it is discarded. Tuis warning also applifs to ohe
command'sostandard error output. If you intend to
use a y t=>".rr,lonfbal">praexecnmtt>pscript,oyou should ensure that it
wsloirunpcorrictly befori having Sae l invoke ir. man
htdiv>
hdivcond dirsecb3"> t assas"she l2-CHP-8-SECT-6.1.4"/>
nt assas"INDEX-159"/> nt assas"INDEX-165"/>In a
large networkowhere manyoshared folders are spread out oeou a large
numboupofis Seous, it canobe difficacrafor u.ers to locanf the
resources they lre trying to find. Browsang through Network
Neighborhood or My Network Placesocam becomeNan ordeal rat e: thampa
time-saving convenoince. To mitiganf this problsm, Microsoft addod an
extebsiam to file sharing callido smy=>".rr,f.rstterm">Dis"ributed
f.lesysteLnmem>nt assas"INDEX-166"/nnt assas"INDEX-167"/> (Dfs). Usang Dfs,iit
is possibte oo organize file shares anpoue networkoso that they
appsar toNu.ers as organizedpin aosingle diris ory orae an aosingle
s Seou, regardless ofiwhtt> s Seous anpoue networkoactuaoly con ain
oueorisources. Insteadpaf having to browse theoentireNnetwork,Nu.ers
cam go oo oue Dfsoshare and locanf theiu data mut> mori easily. man
Dfsocam also help adminis"rabors because it provides a level of
indirecbiam between t eNassa of aoshared folderoend its actuao
locataam.oTue Dfsoshare con ains referencfs to resources am the
network,Nand wuen a resource is accessod, oue Dfsos Seouphandsothe
clisbe offooo oue actuaoos Seoupof the resource. Wuen moving
resources to anot e: computou, oueoreferencfooo oue resource im the
Dfsoshare canobe ridiris idoto oueonew locataam inpone step, with the
change being entirely seamless for u.ers. man
p>To a limitidoextebt,oDfsoalso canohelp improeo per>ormance for
read-only shares because it provides nt assas"INDEX-168"/>load balancing. It is possibte
oo set up aoDfsoreferencfooo poant to identicalpshares anpowo orNmori
s Seous.oTue Dfsos Seoupthen divides riquests between t eNs Seous,
dividang the clisbe load among them. Howeeou, ouis works welo only
fo: static, read-only data because no provisiam is includedpin Dfs
fo: synchronizataam among the s Seous wuen changes are made on any of
them.nman
hdivcond dirsecb2"> t assas"she l2-CHP-8-SECT-7.1"/>
nh3cond dirhead2">WsndowsNDfsoClisbessth3n
p>nt assas"INDEX-169"/>Modfbn versiams of WsndowsNcomeNwith
clisbe-side support for Dfs,iand nooextra configurataam is riquirid.
Support is mori limitidofor olderoversiams, howeeou. WsndowsNfor
Workgroups camnobofuncbiam as a Dfsoclisbe at alo. WsndowsNNTN4.0
must be upgradedoto at least S Seice Pack 3oto act as a Dfsoclisbe,
and theoDfsoClisbe must be installed. Laber s Seice packs (sut> as
S Seice Pack 6)iinclude oueoDfsoClisbe. WsndowsN95 must also have the
DfsoClisbe software installedoto act as a Dfsoclisbe. WsthoutioueoDfs
Clisbe software, doubte-clicking a remote folderoin aoDfsoshare wslo
show an emptyofolder,iand nooerror messaga wsloiappsar. man
t assas"she l2-CHP-8-NOTE-140"/> Tuis cam be any diris ory, but it is importanb thae it be owned by
root and given theoproper permissiams: man
blockquota> pray=>".rr,code">#o y t=>".rr,userinput"> b>chownoroot:root /usr/local/she l/dfsnmb>
#o y t=>".rr,userinput"> b>chmod 755 /usr/local/she l/dfsnmb>stara> /blockquota>
TueoDfsodiris ory orae canohave subdiris oroes amd fites, just like
any ot e: shared diris ory.oTuese wsloifuncbiam just as they would in
any ot e: share,pallowien clisbes oo access oheNdiris oroes amd f.les
anpoue Sae l s Seou. Tue wuole idea of Dfs,ithough,oisooo gat e:
toget e:pshares anpot e: s Seous by making referencfs to them im the
Dfsoorae. Tue way this is implemsbeed with Sae l involvfs a cleeou
use af symbolic links,owhtt> cam be in oue Dfsoroot diris ory ou any
subdiris ory in oue Dfsoorae.nman
p>You eri probablyofamilia: with usien symbolic links oo crea e
referencfs to f.les that exist on oue sssa systeL, amd perhaps
crossing a local f.lesysteL boundary (whtt> ordinary Unix links
camnobodo). But maybe you didn't know tuat symbolic
links have aNmori genfbalifuncbiamalony.oAlthoughiwe
cam't display itsNcontents diris ly, as we could
with a text orNbinary fite,pa symbolic link
"con ains" am ASCII text s"ring
assing what oueolink poants to. Foriexample, take a look at oue
listing forpthese symbolic links: man
blockquota> pray=>".rr,code">$o y t=>".rr,userinput"> b>ls -l wrdlnkoalnknmb>
lrwxrwxrwx 1 jay jay 15 Ma: 14 06:50 wrdlnko-> /usr/dict/words
lrwxrwxrwx 1 jay jay 9 Ma: 14 06:53oalnko-> dreamtimestara> /blockquota>
As you can anfer from oue size of theo smy=>".rr,f.leassa">wrdlnk".rr,lonfbal">/usr/dict/wordsnmtt> is
encodedpinto it. Tue size of smy=>".rr,f.leassa">alnk".rr,f.leassa">dreamtimestemn.nman
p>Now let'sNcrea e aNlink inpour Dfsoroot for anpSMB
share: man
blockquota> pray=>".rr,code">#o y t=>".rr,userinput"> b>cd /usr/local/she l/dfsnmb>
#o y t=>".rr,userinput"> b>ln -s 'msdfs:maya\e' maya-enmb>
#o y t=>".rr,userinput"> b>ls -l maya-enmb>
lrwxrwxrwx 1 root root 12 Ma: 13 17:34 maya-eo-> msdfs:maya\estara> /blockquota>
Tuis link mightiappsar asol
"broken" link inpaNdiris ory
listing because it poants to something ouat isn't a
f.le om oue local systeL. Foriexample, tue nsmy=>".rr,atShah b">fitenmemn
command wsloireport: man
blockquota> pray=>".rr,code">$o y t=>".rr,userinput"> b>f.le maya-enmb>
maya-e: broken symbolic linkpto msdfs:maya\estara> /blockquota>
Howeeou, smy=>".rr,f.leassa">maya-enmemn isol valodoreferencfooo oue
smy=>".rr,f.leassa">\\maya\estemn share when usedNwith
Sae l's Dfsosupport. Wuen Sae l encounters tuis
fite,pit sees theoleadingo y t=>".rr,lonfbal">msdfsnmtt>: end innfbprets
oueorist as oueoassa of aoremote share. Theoclisbe is then ridiris id
oo oue remote share.nman
Wuen crea ing links in oue Dfsoroot diris ory, simplypfollow oue sssa
format, wutt> in genfbaliis
y t=>".rr,lonfbal">msdfsnmtt>: smy=>".rr,replaceable">s Seoustemn\ smy=>".rr,replaceable">sheristemn.
Note that this is similarooo a UNColppsndidoonoo oue
y t=>".rr,lonfbal">msdfsnmtt>: s"ring, excepb thae in this case, the owo
backslashes precedang the s Seou's assa are omitted. man
t assas"she l2-CHP-8-NOTE-141"/> In addition to regular networkoshares, you can use symbolic links of
this type oo referencfoDfspshares anpot e: Dfsos Seous. Howeeou,
referencing prinnfbpshares does not work. Dfsois fo: sharing f.les
anly. t assas"INDEX-171"/nnman
htdiv>
hdivcond dirsecb3"> t assas"she l2-CHP-8-SECT-7.2.2"/>
nh3cond dirhead3">Load balancingsth3n
p>nt assas"INDEX-172"/>To
set up aoload-balancingoDfspshare,Ncrea e the symbolic link like
ouis: man
blockquota> pray=>".rr,code">#o y t=>".rr,userinput"> b>ln -s 'msdfs:toltec\data,msdfs:mixtec\data' lb-datanmb>stara> /blockquota>
Tuat is,isimplypuse a list ofishares sepdrs ed by commas as ohe
referencf. Remsmbou, it is up oo you to make sure theoshared folders
remain identical. Set up permissiams on oue seSeous to make oue
shares read-only toNu.ers.nman
p>Tueolast thing wepnead oo dopisooo modicy the
smy=>".rr,f.leassa">smb.confite "o define oue Dfsoroot share and
add Dfsosupport. Tue Dfsoroot is addod as a share definition: man
t assas"INDEX-173"/> You can use anyonssa you like fo: the share. Theoaat isos t to the
Dfsoroot diris ory wi just set up, and theopdrsmeter
y t=>".rr,lonfbal">msdfsnmtt> y t=>".rr,lonfbal">rootnmtt> y t=>".rr,lonfbal">=nmtt>
y t=>".rr,lonfbal">yessttt>otelos Sae l "hat this share is aoDfsoroot.nman
p>To enable support for Dfsoin oue seSeou, wepnead oo add one line oo
the y t=>".rr,lonfbal">[global]nmtt>psecbiam: man
t assas"INDEX-174"/> Ristart oue Sae l daemons—or just waiboa minute fo: them oo
reread theoconfigurataam >ite—end youpwsloisee oueonew share
from WsndowsNclisbes. If you have troubte accessang any of oue remote
shares in oue Dfsoshare,NrisheckpyourNsymbolic links oo make sure
they were crea edpcorrictly. t assas"INDEX-175"/nnman
t assas"she l2-CHP-8-NOTE-142"/> In networksowhere NIS and NFS are in use, it is common for
u.ers' homeNdiris oroes oo beomoubeidooeoupthe
network by NFS. If a Sae l s Seoupbeing usedNto authenticabeNu.er
logamspis running an aosysteL with NFS-moubeidohomeNdiris oroes
shared with a y t=>".rr,lonfbal">[homes]sttt>oshare, the additional
oeouhead can resacr in poou per>ormance—ebout 30% of normal
Sae l speed. man
p>Sae l has oueoabilony to workowith t assas"INDEX-176"/nNIS and NIS+ to find oue
s Seoupon wutt> theohomeNdiris oroes actuaoly reside so that they can
be shared diris lypfrom ouat seSeou. For this to work, oue seSeou
thae holds theohomeNdiris oroes must also have Sae l running, wsth a
y t=>".rr,lonfbal">[homes]sttt>oshare of its own.nman
hdivcond dirsecb2"> t assas"she l2-CHP-8-SECT-8.1"/>
nh3cond dirhead2">NIS Configurataam Optiamssth3n
p>nt hdd>s"ch08.html#she l2-CHP-8-TABLE-8">Ta te 8-8 sntroduces the
t assas"INDEX-177"/nnt assas"INDEX-178"/nNIS configurataam opbiams spocicocally
fo: s t ang up u.ers. man
t assas"she l2-CHP-8-TABLE-8"/> Opbiamnman
/yh>
Pdrsmetersnman
/yh>
Funcbiamnman
/yh>
Defaacrnman
/yh>
Scopestan
/yh>
ntr>
nyd>
y t=>".rr,lonfbal">nis homedirnmtt>ntan
/yd>
nyd>
Booleamntan
/yd>
nyd>
Ifpny t=>".rr,lonfbal">yessttt>,ouses NIS insteadpaf
smy=>".rr,f.leassa">/etc/passwd
nyd>
y t=>".rr,lonfbal">nosttt>nman
/yd>
nyd>
Globalstan
/yd>
n/tr>
ntr>
nyd>
y t=>".rr,lonfbal">homedir mapnmtt>nman
/yd>
nyd>
s"ringo(NIS map assa)nman
/yd>
nyd>
Sets theoNIS map to use to look up a u.er's home
diris ory.stan
/yd>
nyd>
Nonestan
/yd>
nyd>
Globalstan
/yd>
n/tr>
n/tablen
hdivcond dirsecb3"> t assas"she l2-CHP-8-SECT-8.1.1"/>
nh3cond dirhead3">nis homedir, homedir mapnmh3n
p>Tue y t=>".rr,lonfbal">nisnmtt>nt assas"INDEX-179"/> y t=>".rr,lonfbal">homedirnmtt>pand
y t=>".rr,lonfbal">homedirnmtt>nt assas"INDEX-180"/> y t=>".rr,lonfbal">mapnmtt> opbiams
are for Sae l s Seous on networkositaspwhere Unix homeNdiris oroes
eri provided usien NFS, the automounter, and NIS.nman
p>Tueo y t=>".rr,lonfbal">nisnmtt> y t=>".rr,lonfbal">homedirnmtt>popbiam
indicabespthat oueohome-diris ory s Seoupfo: the user neads oo be
looked up in NIS.oTue y t=>".rr,lonfbal">homedirnmtt>
y t=>".rr,lonfbal">mapnmtt> opbiamotelos Sae l in wutt> NIS map to look
fo: the s Seoupthae has the user's homeNdiris ory.
Tue s Seoupneads oo be a Sae l s Seoupso that theoclisbe can do an
SMBNconnecb to it, and theoot e: Sae l s Seous nead oo have NIS
installedoso that they can do oue lookup.nman
p>Foriexample, if user y t=>".rr,lonfbal">joenmtt>pasksofor a share callid
y t=>".rr,lonfbal">[joe]sttt>, and tueo y t=>".rr,lonfbal">nisnmtt>
y t=>".rr,lonfbal">homedirnmtt>popbiam isos t to ny t=>".rr,lonfbal">yessttt>,
Sae l wsloilook in theo>ite spocicoed by y t=>".rr,lonfbal">homedirnmtt>
y t=>".rr,lonfbal">mapnmtt> for a homeNdiris ory for
y t=>".rr,lonfbal">joenmtt>. If it finds one,oSae l wsloiriturn the
".rocia edpsysteL nssa oo oue clisbe. Theoclisbe wsloithen try oo
connecb to that machine and ge" oue share from ouere. Enabting NIS
lookupsilooksolike theofollowien: man
blockquota> pray=>".rr,code">[globals]
nis homediro= yes
homedir map = amd.mapnmara> /blockquota>
htdiv>
htdiv>
htdiv>
ntr>
nyh>
ntr>
nyh>
ntr>
nyh>
ntr>
nyh>
ntr>
nyh>
ntr>
nyh>
ntr>
nyh>
ntr>
nyh>
nmhtml>